This week's book giveaway is in the JDBC forum.
We're giving away four copies of Make it so: Java DB Connections & Transactions and have Marcho Behler on-line!
See this thread for details.
The moose likes Servlets and the fly likes IE Mime type resolution? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "IE Mime type resolution?" Watch "IE Mime type resolution?" New topic

IE Mime type resolution?

Alok Pota
Ranch Hand

Joined: Mar 07, 2001
Posts: 185
Is there any way to force IE to always download a file when streaming
its contents to it?
I have the following code...

res.setDateHeader( "Last-modified", file.lastModified());
res.setHeader("Content-Disposition", "attachment; filename=" + file.getName());
and if the file happens to be a txt file or textual in nature IE
renders it in-line (sometimes) and sometimes it shows the download box
Is there a definitive way to make it pop up the Save As box everytime.
I agree. Here's the link:
subject: IE Mime type resolution?
It's not a secret anymore!