Couple of questions.  First, are your users all using the same browser (IE
and/or Navigator), and also, the same version?  We had some troubles with
similar functionality, even between different versions of the same
browser.  IE sometimes tried to be too smart for it's own good in my opinion.

Second, are you setting any caching-related headers by chance?  Our servlet
attempts to set "don't cache this page" headers in certain cases, and
sometimes these affected how our output was treated by the browser i.e.

     res.setHeader("Pragma", "no-cache");
     res.addHeader("Cache-Control", "no-store");
     res.addHeader("Cache-Control", "no-cache");
     res.setDateHeader("Expires", 0);

Jay

 > -----Original Message-----
 > From: Clayton Nash [mailto:[EMAIL PROTECTED]]
 > Sent: Friday, June 07, 2002 12:01 PM
 > To: [EMAIL PROTECTED]
 > Subject: Downloading Document strange error
 >
 >
 > Hi,
 >
 > I'm having a very strange problem with downloading documents.
 > Most of my
 > users have no issue, but a small subset are experiencing some
 > problems.
 >
 > One set can open the document directly into an application (such as
 > word) but cannot save the document. Others have exactly the opposite
 > behaviour. A failure simply doesn't work -- nothing opens or nothing
 > gets saved.
 >
 > On various browsers, I can do both -- my apache and application server
 > logs show no errors.
 >
 > Any comments are gratefully accepted.
 >
 > The code that sends the file is as follows
 >
 >         public void doPost(HttpServletRequest req, HttpServletResponse
 > res)
 >                          throws ServletException, IOException {
 >
 >                 OutputStream obf = res.getOutputStream();
 >                 Response responseObj;
 >                 Hashtable respHash;
 >                 responseObj = (Response)
 > req.getAttribute("responseObj");
 >                 respHash = responseObj.getHash();
 >                 byte[] buf = (byte[]) respHash.get("FILEBUFF");
 >                 String f_Name = (String) respHash.get("FILENAME");
 >                 int fileSize = buf.length;
 >
 >                 res.setHeader("Content-disposition", "attachment;
 > filename=" + f_Name);
 >
 >                 int pos;
 >                 String ext;
 >                 pos = f_Name.lastIndexOf(".");
 >                 ext = f_Name.substring(pos + 1).toLowerCase();
 >
 >                 if (ext.equals("doc")) {
 >                         res.setContentType("application/msword");
 >                 } else if (ext.equals("pdf")) {
 >                         res.setContentType("application/pdf");
 >                 } else {
 >
 > res.setContentType("application/octet-stream");
 >                 }
 >
 >                 res.setContentLength(fileSize);
 >
 >                 obf.write(buf);
 >                 obf.flush();
 >                 obf.close();
 >         }
 > }
 >

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to