我有一個安裝在safari中工作的ios應用程序的鏈接。
<a href="itms-services://?action=download-manifest&url=https://acqshop.com/manifest/category/Farsi/ashpazi.plist"></a>
現在我想隱藏用戶的鏈接,但我不知道如何做到這一點。 我的onclick用於鏈接:
<a href="javascript:void(0);" onclick="javascript:install();" target="Farsi/ashpazi.plist"></a>
function install() {
if (!isMobile()) {
alert('you can download from ios devices');
return;
}
var post_link = $(this).attr("target");
url = 'install.php?name='+post_link;
window.location.href = url;
}
和install.php了:
<?php
$name = $_GET['name'];
$path = 'itms-services://?action=download-manifest&url=https://acqshop.com/manifest/category/'.$name;
$mm_type="application/octet-stream";
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Type: " . $mm_type);
header("Content-Length: " .(string)(filesize($path)));
header('Content-Disposition: attachment; filename="'.basename($path).'"');
header("Content-Transfer-Encoding: binary\n");
readfile($path); // outputs the content of the file
exit();
?>
,但它不能正常工作。我的錯誤是什麼?
你可以看到一個例子的onclick功能,在這個網站上下載iOS應用:
ipa.othman.tv/ipa/vi2.php
但我不能understant什麼是在installvi2.php功能
(請參閱頁面源)
謝謝。
感謝@Shynggys 我改變install.php了到:
<?php
$name = $_GET['name'];
$path = 'itms-services://?action=download-manifest&url=https://acqshop.com/manifest/category/'.$name;
$mm_type="application/octet-stream";
header("Pragma: public");
header("Expires: 0");
header('Location:' .$path);
?>
,你可以看到的onclick功能相關的例子來下載iOS應用在這個網站:http://ipa.othman.tv/ipa/vi2.php,但我不能瞭解什麼是功能離子在installvi2.php – fraweb 2015-02-07 18:45:05