+ 2
How to add download button to my website?
4 odpowiedzi
+ 3
You can do:
<form method="get" action="path_to_file/file.zip">
<button type="submit">Download</button>
</form>
or even better (with html5):
<a href="path_to_file" download="file.zip>
<button>Download</button>
</a>
+ 2
the above code by @Rustam gives you the solution but to let you know how it works.
When you create a link with '<a href' and point it to the file in the server, the browser tries to read and interpret in the browser but it can't interpret anything other html so if you point to a zip file, doc or ppt then the browser tries to download it by default.
+ 2
thank you
0
Surya is right