This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Servlets and the fly likes response.setHeader( Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "response.setHeader("Content-Disposition") not working in IE alone" Watch "response.setHeader("Content-Disposition") not working in IE alone" New topic
Author

response.setHeader("Content-Disposition") not working in IE alone

Thanuja Vishwanath
Ranch Hand

Joined: Oct 07, 2010
Posts: 49
Hi all,

Iam creating a PDF and open that in browser using servlet. When user save that PDF, then the file name will be saved as its project name which is passed.

Iam setting the file name like this



When i save the PDF in chrome and firefox it is saved with the project name. Whereas if i save the PDF in IE then the file name is saved as the Servlet name and not the name mentioned in the content disposition.

Please advise.


Thanks,
Thanuja.
Tamas Ragoncsa
Greenhorn

Joined: Feb 25, 2011
Posts: 6

Hi Thanuja,

my experience is the same IE's behavior is strange with file downloads.
However there are some best practices.
http://onjava.com/pub/a/onjava/excerpt/jebp_3/index3.html

I hope this helps.

Tamas
 
Don't get me started about those stupid light bulbs.
 
subject: response.setHeader("Content-Disposition") not working in IE alone
 
Similar Threads
File-download naming problem in IE 6
renaming pdf file via servlet
Change file name without prompt to save
Content-Disposition: Download file name problem
Title as PDF file name