This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I have servlet which creates and send a pdf based file and i ask it to open inline inside of a browser window.
This works as intended, but when i try to "save" the file from the Adobe's menu, it just takes the servletname for the file name instead of actual filename i supplied.
Did anyone overcome this issue?
Joined: Dec 01, 2009
Code is something similar to below:
response.setContentType("application/pdf"); // MIME type for pdf doc
String downloadreportname = "CustomeFileNameGenerated.pdf";
//set response headers
response.addHeader("Content-Disposition", "inline; filename=" + downloadreportname);
Thanks for your reply, appreciate your help.
Well i know about inline & attachment clauses, and thats what my intention is... to display the pdf inline inside browser.
But after the PDF is loaded inside the browser and we want to hit save on the Adobe's plugin's menu inside the broswer, then it provides a dialog box which should prompt me to save the file.
So far so good, but the prompted name that is displayed is NOT the name i intended it to be, its with the servlet's name.