aspose file tools*
The moose likes Servlets and the fly likes Setting response header Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Setting response header" Watch "Setting response header" New topic
Author

Setting response header

Ludmila Snova
Greenhorn

Joined: Aug 31, 2006
Posts: 20
Hi all,

This site really helped me to pass my certification exam and I hope to get some help with issue I have been struggling the second week.

I am streaming the different types of files (PDF, DOC, and XML) and open them directly in the browser. The requirement is to keep the original name of the file, if user wants to save the opened file using the standard browser menu File-> Save As. In my java code, I set the following response header:

res.setContentType(Mimetype);
res.setHeader("Content-Disposition", "inline; filename=" + filename + ";");

It should work and it works fine with Mozilla Firefox, but it does not work with IE. I tried different combination of headers and quotation marks. Nothing is working for IE. I read that some versions of IE do not work properly with Content-Disposition header.
Is there some workaround for this? Please, help.

Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Setting response header
 
Similar Threads
Cannot open PDF directly, save works
Not able to view popup to save xls file(in IE7), writing file into servlet response.
Downloading file from server
urgently needed help
Page cannot be displayed issue in jsp