IE6 turns jar into zip

。_饼干妹妹 提交于 2019-12-10 23:55:04

问题


Using windows server, I have a path to a file that, when you click the button, executes the jar file and runs the program. At least in firefox. The problem occurs with IE6. It takes my file.jar and turns it into file.zip. Any suggestions here?


回答1:


Firefox can determine correct mime-type by extension first, and check header information to find out if there's a congruent match. IE6 unfortunately doesn't.

JAR file is actually is a ZIP file (rename a JAR file to zip and it'll be opened easily with Winzip) change the JAR mime-type to "application/java-archive".

Update
On IIS:

  1. Select the site to configure in IIS, right click and select "Properties"
  2. Under HTTP Headers Tab, select "File Types" under the MIME Map section and select "New Type"
  3. Type ".jar" as the associated extension and "application/java-archive" as the content type.
  4. Select "OK" and you're ready to go!
  5. Restart IIS.



回答2:


You need to have an administrator set it in IIS on your web server, so that files served with the .jar extension use the "application/java-archive" mime-type.

In IIS6, right-click on the web site and choose "Properties". Go to the "HTTP Headers" tab, and in the bottom you'll see a section called "MIME Map". Click on the button "File Types" and add the following two types:

Extension: jar
Content-type: application/java-archive

In IIS7, you will see an icon called Mime-Types and click on that and then use the "Add" to add a new type.



来源:https://stackoverflow.com/questions/2444160/ie6-turns-jar-into-zip

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!