我将黑莓应用程序的可交付变量上传到服务器。我希望我的用户从 URL 安装该应用程序。在上传到远程服务器之前,我在本地主机上进行了测试。没问题。但是,当我尝试从服务器下载 .jad 文件时,它会显示文件内容,但不会安装应用程序。
显示文字:
Manifest-Version: 1.0
RIM-COD-Module-Name: .....
我认为这与 mime 类型有关,因此将这些行添加到包含应用程序文件的文件夹中的 .htaccess 文件中:
Options -Indexes
AddType text/vnd.sun.j2me.app-descriptor .jad
AddType application/vnd.rim.cod .cod
AddType application/java-archive .jar
那也没有解决。我不知道还能做什么。
.cod、.jad、.jar .. 文件全部上传。
更新:使用 php 解决。
$url = 'http://myserver.com/myapp.jad'
$jadContents = "";
try {
$file = fopen($url, 'r');
$jadContents = fread($file, filesize($url));
fclose($file);
} catch (Exception $e) {
var_dump($e->getMessage());
$jadContents = "";
}
if ($jadContents != "") {
header("HTTP/1.1 200 OK", true);
header("Content-Type: text/vnd.sun.j2me.app-descriptor", true);
header("Content-Length: " . strlen($jadContents), true);
echo($jadContents);
}
启用.htaccess 文件 http://httpd.apache.org/docs/2.0/howto/htaccess.html,你需要添加
<Directory /somedir>
Allowoverride All
</Directory>
到httpd.conf
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)