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