Skip to main content

Command Palette

Search for a command to run...

How to create a download link in HTML?

Published
•1 min read
How to create a download link in HTML?
D

I am 17 years old and a young passionate and self-taught frontend web developer and have an intention to become a successful developer. I usually write about JavaScript and Web Development and share some tips in the articles.

To let users download files like (PDFs or PPTs, etc.) from your website using HTML,

<a href="file.pdf" download>Download</a>

This will force the file to be downloaded into the device (even if files like PDFs can be loaded in the browser).

Note: This will only work on links of same origin

Thanks for reading

Follow me on Twitter

Thanks for reading!

More from this blog

D

Dhairya Shah

119 posts