我的网站的 Jad 文件下载链接
我正在通过 webs.com 为我和我的朋友建立一个小型网站,也可以通过 wap(即移动互联网)访问该网站,并且我想添加指向下载 .jar 文件的网站的链接。我将文件上传到我的网站上,并且 .jar 文件的链接运行良好,但我还需要 .jad 文件的链接(对于某些首先需要 .jad 文件然后是 .jar 的手机)。我尝试对 .jad 文件进行常规链接,但它仅显示 .jad 文件的内容。它没有安装或下载。我应该怎么办?或者我访问了错误的网站?谢谢!
I am putting up a small website via webs.com for me and my friends that could also be accessible via wap, i.e. mobile internet, and I want to add links to my site that downloads .jar files. I uploaded the files on my site, and links to the .jar files went fine, but I also need links for .jad files (for some mobile phones that require .jad files FIRST then .jar). I tried doing a regular link for the .jad files, but it simply displayed the content of the .jad file. It wasn't installed or downloaded. What should I do? Or am I at a wrong website? Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
JAD 文件是基于文本的。它们的默认内容类型是
text/vnd.sun.j2me.app-descriptor
。默认情况下,每个网络浏览器都会显示内容类型与text/*
内联匹配的响应。最佳解决方案是配置/更改响应标头以包含值为
attachment
的Content-Disposition
。这样,网络浏览器将被迫弹出“另存为”对话框。目前尚不清楚您在网站中使用哪种服务器端编程语言,但如果是 PHP,那么您可以这样做:或者如果是 Java/Servlet:
或者如果您不使用任何语言,您可以尝试使用它们JAD 文件同一目录中的
.htaccess
:JAD files are textbased. Their default content type is
text/vnd.sun.j2me.app-descriptor
. Every webbrowser will by default display responses with a content type matchingtext/*
inline.The best solution is to configure/change the response header to include a
Content-Disposition
with a value ofattachment
. This way the webbrowser will be forced to pop a Save As dialogue. It's unclear what server side programming language you're using in the website, but if it is for example PHP, then you can do so:Or if it is Java/Servlet:
Or if you are using none, them you may try it with an
.htaccess
in the same directory of the JAD files: