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.
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();