I am usinhg JSP to show pdf or word files in IE browser. The files are stored as Blob in Oracle database. The following code should show the file when I run JSP, but it shows all garbage along with text of pdf file. I tried the same with another file that is stored as word after changing content type to application/windoc that also does not work. What am I doing wrong here? I did verify that file was right as I laoded them using Oracle utility.
BLOB b = ((OracleResultSet)rset).getBLOB (1);
byte ba = b.getBytes(1, (int)b.length()); response.setContentType("application/pdf");
OutputStream os = response.getOutputStream(); os.write(ba); os.close(); b.close();
This is why you should never use a JSP to do a Servlets job. And please don't ask what is essentailly the same question more than once. Please continue any discussion in the original topic. [ May 20, 2005: Message edited by: Bear Bibeault ]