Or you can just use the new HTML5 download
property in your html anchor tag.
The code will look something like this:
<a download href="path/to/the/download/file"> Clicking on this link will force download the file</a>
It works with the latest version of Firefox and Chrome. Should I mention that I have not tested it in IE ?: P
source share