How do I make a button that downloads a file

I was just wondering how I can make a button that when you click downloads a certain file?

Just link to the file with the download attribute:

<a href="/path/to/file" download>Download</a>

This will tell the browser that the file is for download, not for viewing. The browser will usually still download unpreviewable files like .zip.

Do note that our hosting is not for file sharing, so you probably want to find somewhere else to host these files.

7 Likes

but like image, exe, etc? how would i make it so when it goes to that file it just automatically downloads it?

Ah nvm I see the download part of it, thanks so much.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.