• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Shreyaswini Kolali
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 55
Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Which version of IE you are using. I think this issue is no longer visible in IE8 and later.
 
vipul bondugula
Ranch Hand
Posts: 222
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic