Discussion Locked

How toopen download window netscape&IE

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have requirement to open a download window after clicking a link for text file in both netscape4.5 and IE browsers.
The client code is in JSP.
Server logic in Bean.
I don't wan't to use shift click kind of workaround.

3 replies

by jay eckles

Please refer to the following FAQ:
http://www.htmlhelp.com/faq/html/media.html#force-download

>>>
5.4. How do I force the browser to download a file?
You can't, because the Web doesn't work that way.

As explained in the answer to the previous question, the server is responsible for identifying a document's media type properly, and the browser is responsible for deciding how to handle the document (based on its media type). There is no way for a web author to override the way the browser is configured to handle any given type of file.

Most browsers allow the user to download to disk if they want to. If the file must be saved to disk, if there is absolutely NO other way to handle it, the MIME type should be "application/octet-stream".
<<<

So, if it is absolutely imperative that you open a download window, I would try setting the content-type to "application/octet-stream", then sending the data in a binary format. Results may be mixed, though.

Good luck.

Jay Eckles
www.jayeckles.com

This discussion is closed to new replies.