I’m saving a pdf file with the following part of the code:
response.setContentType("application/pdf");
response.setHeader("Content-disposition",
"inline; filename="+pd.getName()+"_"+version+".pdf") ;
response.setContentLength(baosPDF.size());
java.io.OutputStream os;
os = response.getOutputStream();
baosPDF.writeTo(os);
When I right click on save the file in my page, in Chrome and Firefox it is named correctly by default:
"NameOfPd_VersionNumber.pdf"
But only in Internet Explorer 8 is named:
"printPDFAction.pdf"
where printPDFAction is the name of the action which creates the pdf.
How can I solve that? Thanks in advance.
Use the following header:
also for IE, use these headers (IE sometimes has problems opening files which it saved a moment ago):