I am giving link of a pdf file on my web page for download, like below
<a href='myfile.pdf'>Download Brochure</a>
The problem is when user clicks on this link then
- If the user have installed Adobe Acrobat, then it opens the file in the same browser window in Adobe Reader.
- If the Adobe Acrobat is not installed then it pop-up to the user for Downloading the file.
But I want it always pop-up to the user for download, irrespective of ‘Adobe acrobat’ is installed or not.
Please tell me how i can do this?
Instead of linking to the .PDF file, instead do something like
which outputs a custom header, opens the PDF (binary safe) and prints the data to the user’s browser, then they can choose to save the PDF despite their browser settings. The pdf_server.php should look like this:
PS: and obviously run some sanity checks on the ‘file’ variable to prevent people from stealing your files such as don’t accept file extensions, deny slashes, add .pdf to the value