views:

169

answers:

2

When I upload a jar file to my web server, people using Firefox or Opera don't have any problems downloading it. But when the link is downloaded with Internet Explorer, IE unzips the contents of the jar, instead of simply downloading it. Is there a way to prevent IE from doing this?

A: 

I encountered this problem too. The (unexpected) solution was to place a query string on the end of the URL.

Apparently, Internet Explorer isn't paying attention to mime types, content-type headers, or any other relevant information from the HTTP response. Instead, it is looking at the URL, seeing that it ends in ".jar," and behaving in a particular way as a result. (!@#$!!) Fortunately, if the URL does not end with ".jar", the unzipping feature seems to go away.

Appending a query string causes the URL to no longer end with ".jar". Any query string will work, and your website can just ignore the query string.

So take the download URL, and append "?j" to the end. For example:

http://yourserver.example.com/filename.jar?j

And Internet Explorer will download your file properly.

David T
A: 

This does not seem to work on IE 7 :(

Misha Koshelev