• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Content-Disposition: Download file name problem

 
Shanu Paul
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

In my servlet I am trying to let the user download a file using the following code:

response.setContentType("application/msword");
response.setHeader("Content-Disposition","attachment; filename=wordfile.doc");

This works fine in Netscape, but when trying to do this in IE (including IE 6.0) the filename is the name of the servlet and not the file name specified. Is there anyway to fix this? If IE cannot handle the Content-Disposition correctly, is there any other way other than using Content-Disposition to handle it.

Please let me know. Many thanks.

Regards,
Shanu
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you try with double quotations around the filename ?
 
Scott Selikoff
author
Saloon Keeper
Posts: 3905
16
Eclipse IDE Flex Google Web Toolkit
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Might want to review: http://www.onjava.com/pub/a/onjava/excerpt/jebp_3/index3.html

They have some tips for how to help with IE.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic