Or you could just use the new HTML5 property download
in the anchor tag of your html.
The code will look something like
<a download href="path/to/the/download/file"> Clicking on this link will force download the file</a>
It works on firefox and chrome latest version. Should I mention that I didn't check it in IE? :P
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…