Download PDF file from iPad
I have a server side component (i.e. a Servlet) that creates a PDF file and sent it back to the browser with this response header:
res开发者_StackOverflowponse.setContentType("application/pdf");
response.setHeader("Cache-Control", "cache");
response.setHeader("Pragma", "cache");
response.setHeader("Content-Disposition", "attachment;filename=document.pdf");
All works fine in all browser except on iPad. On iPad the content is showed but the browser does not ask me if I want to save the file.
Any idea how to fix this issue?
Ok I found that it was the correct ipda behaviour: if is not installed any program that can handle pdf (e.g. FileApp) safari shows the preview in a read-only mode. If it is installed a program that can handle those files safari prompts for what to do on those file.
Massimo
if you want to download the right name of the PDF file you need to edit the metadata of the PDF file. As you introduce the title of the document, you may put the Author and more details in the Metadata. You can see the info in Windows looking at the properties. It is posible to edit that metadata downloading a free program like http://www.becyhome.de/download_eng.htm#becypdfmetaedit.
I hope it helps you!.
Good luck.
Carlos
精彩评论