Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

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

843842Oct 29 2008 — edited Oct 29 2008
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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 26 2008
Added on Oct 29 2008
4 comments
234 views