Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

force download of a binary file

 
Charles Cayman
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I would like to force IE to download a binary file, like a .pdf, or .doc file.
What I do is I call:
res.setContentType("application/octet-stream");
However, IE still displays the contents of the file. What I want is to force the display of a "Save As" dialog box.
How can I go about doing this? Thank you.
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use this as well:

/Rene
 
Charles Cayman
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rene,
Thanks for the tip, it works!
However, I couldn't find this technique anywhere else. I mean, I have two books (O'reilly and Sun), but they both don't have anything about this Content-disposition header.
What I want to find out is where or how can I know about things like this when get stuck again in the future?
Thanks again in advance.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic