+ 2
How to creat working download button
4 Réponses
+ 10
Some Other Ways....
Way#1
<form method="get" action="file.doc">
<button type="submit">Download!</button>
</form>
Way#2
<button type="submit" onclick="window.open('file.doc')">Download!</button>
Way#3 (Bootstrap Version)
<a class="btn btn-danger" role="button" href="path_to_file"
download="proposed_file_name">
Download
</a>
+ 11
I have done some research and found the best answer. You can trigger a download by using the new HTML5 download attribute.
<a href="path_to_file" download="proposed_file_name">Download</a>
Where :
*path_to_file is either an absolute or relative path,
*proposed_file_name the filename to save to (can be blank, then defaults to the actual filename).
Hope this is helpful.
+ 5
<a download href="downloads/file.zip">
Download Fonts
</a>
+ 1
The best solution is:
<a href="file" download>Download</a>
*Just you need to use 'download' after href property
you can use your button within the <a> tag