aspose file tools*
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "response.setheader("content-disposition") does not work in IE" Watch "response.setheader("content-disposition") does not work in IE" New topic
Author

response.setheader("content-disposition") does not work in IE

Shreyaswini Kolali
Greenhorn

Joined: Aug 02, 2011
Posts: 3
Hi,

My piece of code is as follows where the file name is generated dynamicsally each time based on the users' input.
The code executes very well in Firefox & chrome. But in IE when i try to open the excel sheet that is exported, the name of the file remains same as the servelet name.

String excelName = Util.getExcelName(entityType, entityName, effectiveDate);
response.reset();
response.setContentType("application/x-download");
response.setHeader("Content-Disposition", "attachment; filename=" + excelName );

Can anyone please help me with this issue.? It is specific to only IE.

Thanks,
Shreya
N Sahni
Ranch Hand

Joined: Jul 07, 2011
Posts: 55

Hi,

Which version of IE you are using. I think this issue is no longer visible in IE8 and later.


Thanks and Regards,
Nilesh Sahni | nsahni@infocepts.com | www.infocepts.com
vipul bondugula
Ranch Hand

Joined: Oct 14, 2010
Posts: 218
Hi Shreyaswini,

response.setContentType("application/x-download");


Replace with this code
response.setContentType("application/vnd.ms-excel");.Once try this.May be this will be helpful for your scenario..

Cheers...

Thanks
Vipul Kumar
 
wood burning stoves
 
subject: response.setheader("content-disposition") does not work in IE