servlet file download works in Firefox, but not in IE

"Jianshuo Niu" <[email protected]>
Newsgroups gmane.org.user-groups.trijug.juglist
Message-ID <[email protected]>
Hi!There:

I wrote a java servlet to display binary files, such as html, doc, pdf, jpg
files. And the function works under firefox browser, but failed in IE with
PDF and Word file type.

Here are part of the code:
//
response.setContentType(attachment.getImage().getContentType());
      response.setContentLength(attachment.getImage().getImageSize());
      OutputStream os = response.getOutputStream();
      os.write(attachment.getContent());
      response.setStatus(HttpServletResponse.SC_OK);

//
I did some study and tried to add the following line.
response.setHeader("Pragma","public");
 And it failed as well.

Can anybody help me on this issue?

Thanks

Joshua

_______________________________________________
Juglist mailing list
[email protected]
http://trijug.org/mailman/listinfo/juglist_trijug.org
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.