I am attempting to build a pdf file from xml on the fly and then send this pdf file to a user of my site. I have managed to do this. However, once the pdf has loaded into the browser, if the user clicks on the "Save a Copy" button, the filename automatically given is the url of the pdf file. How can I set this to something else?
I know I could save a temp file server-side but that is not something I want to do unless absolutely necessary.
Below is the code I'm using:
Code:XSLTCls objXSLT = new XSLTCls(servletContext); byte[] content = objXSLT.transform_pdf(strXHTML, map); response.setContentType("application/pdf"); response.setContentLength(content.length); response.addHeader("Content-Disposition", "inline; filename=\"aow1234.pdf\";"); response.setContentLength(content.length); OutputStream outStream = response.getOutputStream(); outStream.write(content);


Reply With Quote


Bookmarks