When downloading jar files in IE and other browsers, change the suffix to zip and other problems and solutions

Source: Internet
Author: User

When downloading jar files in IE and other browsers, change the suffix to zip and other problems and solutions

 

The recent jar download has encountered the following problems during this process:

1. When downloading jar from IE, roaming, and TT, the suffix jar will be changed to zip;

2. When Firefox and opera click to download the JAR file, the JAR file is opened in the browser and garbled characters are displayed;

 

360 and windows of the world can be downloaded normally without changing the suffix to another one. I was confused about the above problems. At first I thought it was a browser problem. But when I went to the UC website to download UC, its files were jar files, it can be downloaded normally and won't be renamed, but it is not directly linked to the file.

 

At this time, I think this problem can be solved by writing a file stream, because the file type and name can be controlled during file stream writing, I tried to change the direct download link of the file to the method of writing the file stream through servlet, in this way, Internet Explorer, Internet Explorer, TT, Firefox, 360, and windows of the world can be downloaded normally and cannot be renamed, however, opera will change the jar suffix to EXE during the download process. This is even more frightening and makes users think it is a virus; at this time, I also think it is a problem with the operabrowser itself (because it is often seen on the Internet that opera is relatively junk @ _ @). After discussing with Xiao Ke, I am ready to release it like this, I am also freed from spending nearly a day solving this problem (it turns out that I have completely reversed ).

 

At this time, my boss came up and said that this problem was quite interesting. At the beginning, I decided that this should be the setup problem of JBoss. After a few simple tests, locate the problem directly to httpd. mime. on types, open the file and find that there are many types, but there is no jar type. At this time, I also realized that adding the jar type to this file may succeed, next I found the corresponding type settings based on the combined keyword of "jar mime:

Application/Java-archive jar

Add the above sentence to mime. Types and restart the service. All the seven browsers I mentioned above can be downloaded normally (it doesn't seem like a problem with opera ).

 

Summary:

1. Ginger is old and spicy;

2. Constantly Improve yourself and find the cause from yourself when you discover the problem;

 

This article is from:Feng Libin's blog

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.