wood burning stoves 2.0*
The moose likes Servlets and the fly likes Content type = application/force-download not working for IE Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "Content type = application/force-download not working for IE" Watch "Content type = application/force-download not working for IE" New topic
Author

Content type = application/force-download not working for IE

Manish Ramrakhiani
Ranch Hand

Joined: Aug 20, 2009
Posts: 44
Hi all,

I have written a Servlet with:


However, this is working absolutely fine on Chrome but when I run it on IE, it throws error saying"can not download from servlet name".

Any pointers, what could be the problem.

Thanks,
Manish Ramrakhiani
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

what version of IE?
One problem is that in some versions it tries to be too clever about the content type and tries to work it out on its own.
A hack we have used on occasion is to add a fake extension at the end of the URL to provide a hint, but in your case you want the opposite.
To do this, add ".csv" as the last parameter on the URL eg /context/MyServlet?.csv or /context/MyServlet?param1=value&.csv
I kid you not.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Content type = application/force-download not working for IE