dhairyashah
Portfolio

Aug 24th, 2022

How to create a download link in HTML?

Author Picture

Dhairya Shah

Software Engineer

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!