Hi guys,
I am trying to read contents of PDF from the database as bytearray. Then i am simply flusing the bytearray on the
JSP page. I have a link on the JSP page which when clicked should open the PDF file.
When i am clicking the link, it is showing some garbled content in the Internet Explorer. While i am trying to open the same link in the Firefox and it is working perfectly fine.
I have seen some solutions on google but doesnt seem to work.
My code is as follows:
response.setHeader("Cache-Control", "no-cache");
response.setDateHeader("Expires", 0);
response.setHeader("Pragma", "No-cache");
response.setContentType("application/pdf");
byte[] array = (byte[]) session.getAttribute("pdfFile");
ServletOutputStream outstream = response.getOutputStream();
outstream.write(array);
outstream.flush();
Any quick help in the matter would be highly appreciable.
Saurabh