This is a common problem, and few know about a simple HTML 5 solution:
<a href="./directory/yourfile.pdf" download="newfilename">Download the pdf</a>
Where newfilename is the suggested file name for saving the file. Or it will default to the file name on the server if you leave it empty, for example:
<a href="./directory/yourfile.pdf" download>Download the pdf</a>
Compatibility: I tested this on Firefox 21 and Iron, both worked fine. This may not work with HTML5-incompatible or outdated browsers. The only browser I tested that did not force download was IE ...
source share