How can i by pass the IE SP2 information popup while downloading the pdf

Hello Guys,
I am downloading pdf from my web application (Weblogic 8.2). it work perfectly fine on my local box which uses http protocol. But when we are deploying the application on UAT environment which have other component integrated to it it pop up a annoying information pop up. As a result of which user needs to perform a one more extra step to download the pdf.
I looked at many solution given on the MS site to change the setting of the IE but we want to do something from the server side so that we dont have to change the user setting manually which will require the support from our side.
Please help !!!!!
Code for download
try{
               outputStream = res.getOutputStream();
//               byte[]bytes = toByteArray(tempFile);
               byte[]bytes = getDocServer().convert(files);
               res.reset();
               res.setContentLength(bytes.length);          
               res.setHeader("Content-disposition", "attachment;filename=\"" + "please_name_your_file.pdf\"");
               res.setContentType("application/pdf");
               res.setHeader("pragma", "public");
               res.setHeader("Cache-Control", "public");
               res.getOutputStream().write(bytes);     
               res.getOutputStream().flush();
/*               res.setContentType(SaveToFileConstant.SAVE_TO_FILE_PDF_CONTENT_TYPE);
               res.setContentLength(bytes.length);
               res.setHeader("Content-Disposition", "attachment;filename=\"" + "please_name_your_file.pdf\"");
               outputStream.write(bytes);
               outputStream.flush();
*/          }catch(Exception e){
               throw new RuntimeException(e);
          }finally{
             if(outputStream !=null) outputStream.close();
             List tempList  = new ArrayList();
//             System.out.println("Inside Finally ******* StreamToPDFFile : File Name ******"+tempFileName);
             tempList.add(tempFileName);
             deleteAllTempFiles(tempList);
~Manoj

mkumar1980 wrote:
Hi,
Thanks for the quick response. I will see how can i use the InputStream as we have utility which create the pdf doc on the fly and returns the byte stream.
But you are write if the size is large then i will eat up the memory.Huh, write? What are you saying?
Anyway, each byte in Java costs at least one byte of memory. So if the PDF file is for instance 100MB, then 100MB of memory will be eaten. Imagine what happens if only 10 users downloads it concurrently while your server has only 1GB assigned to JVM.
I am getting information bar (not pop up) just below the address bar. It says following
*" To help protect your security, Internet Explorer blocked this site from downloading files to your computer. Click here to see more options...."*Oh, that thing. Are you sending the file to the client unexpectedly? Are you doing this stuff in a JSP file instead of a Servlet?

Similar Messages

Maybe you are looking for