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
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?
This is a common issue but few people know there's a simple HTML 5 solution:
<a href="./directory/yourfile.pdf" download="newfilename">Download the pdf</a>
Where newfilename
is the suggested filename for the user to save the file. Or it will default to the filename on the serverside if you leave it empty, like this:
<a href="./directory/yourfile.pdf" download>Download the pdf</a>
Compatibility: I tested this on Firefox 21 and Iron, both worked fine. It might not work on HTML5-incompatible or outdated browsers. The only browser I tested that didn't force download is IE...
Check compatibility here: http://caniuse.com/#feat=download