我有一个安装在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