I am not using it with all the app server you mentioned but in my mimetype
string is "application/octet-stream" and it works.  However, it also doing
the double request like you mentioned.  When you find out why it's doing
that, please post.

Thanks.

-----Original Message-----
From: Summers, Bert W. [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 11, 2004 1:55 PM
To: [EMAIL PROTECTED]
Subject: Streaming pdf document fails

I have a problem that just came up.  I have PDF documents located out side
of my webapps directory.
When the user wants one they go to my servlet which streams it back.
This use to work just fine, but now is broke.
 
In IE I get Error opening document on TC4.1.30 and unable to open this
Internet site in TC 5.0.19
 
Mozilla 1.6 does not have a problem opening the file.
 
What is odd is that Mozilla seems to request the servlet twice from one
click, the first tends to throw this
ClientAbortException:  java.net.SocketException: Software caused connection
abort: socket write error
        at
org.apache.coyote.tomcat4.OutputBuffer.realWriteBytes(OutputBuffer.java:410)
        at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:332)
        at
org.apache.coyote.tomcat4.OutputBuffer.writeBytes(OutputBuffer.java:438)
        at
org.apache.coyote.tomcat4.OutputBuffer.write(OutputBuffer.java:425)
        at
org.apache.coyote.tomcat4.CoyoteOutputStream.write(CoyoteOutputStream.java:1
08)
        at GetPDFDoc.outputFile(GetPDFDoc.java:128)
        at GetPDFDoc.processRequest(GetPDFDoc.java:86)
        at GetPDFDoc.doGet(GetPDFDoc.java:147)
 
Is there anything wrong with what I am doing?
      response.setContentType("application/pdf");
      response.setDateHeader("Expires", 0);
// open pdf outside of browser
      response.addHeader("Content-disposition", "attachment; filename=" +
ntspNo + ".pdf");
      response.setContentLength((int)f.length());
      java.io.OutputStream out = response.getOutputStream();
// f is the pdf on the file system and it does exist
      java.io.FileInputStream in = new java.io.FileInputStream(f);
      int size = 0;
      byte[] buffer = new byte[8192];
      while( (size = in.read(buffer, 0, buffer.length)) != -1)
      {
        out.write(buffer, 0, size);
      }
      in.close();
      out.close();
 
Thanks


***************************** 
This communication may contain information that is proprietary, privileged,
confidential or legally exempt from disclosure.  If you are not a named
addressee, you are notified that you are not authorized to read, print,
retain, copy or disseminate this communication without the consent of the
sender and that doing so may be unlawful. If you have received this
communication in error, please notify the sender via return e-mail and
delete it from your computer. Thank you. St. Jude Medical, Inc. 
*****************************

Reply via email to