*
The moose likes Servlets and the fly likes Downloading a file from servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Downloading a file from servlet" Watch "Downloading a file from servlet" New topic
Author

Downloading a file from servlet

sneh rai
Greenhorn

Joined: Jun 27, 2001
Posts: 1
Hi,
I have written a servlet to download a file(a text file) to the user's m/c. It works just fine on IE 5.0 and any version of Netscape. But when I try it on IE 5.5, the text file is opened in the browser and when I further try to save it, it tries to save the servlet instead of the file. Please advise.
Thanks in advance,
Sneh.
Cameron Park
Ranch Hand

Joined: Apr 06, 2001
Posts: 371
Someone already asked this question recently. You can change the extension of the text file to say. ".dat". And because it is not one of the MIME types, the browser will probably not open it.
 
Don't get me started about those stupid light bulbs.
 
subject: Downloading a file from servlet
 
Similar Threads
Incorrect file type when creating file from servlet
How to download different files in struits dppending on the file format
How to set browser title using HTTP Header from a Servlet?
possible to create xml file from servlet
IE Hangs when I use servlet to download a file