Anchor Tags (HTML)

Download

Using the download attribute will instruct the browser to download the file enclosed in the value of the download attr. The value is optional.

<a href="file.pdf" download>Download Here</a>
<a href="file.pdf" download="new-filename.pdf">Download Here</a>

So far I have not seen the attribute force a download of a file, but I have seen it change the download name of the file re: things like PDFs.

References

  1. https://stackoverflow.com/questions/23825871/how-to-force-a-download-file-prompt-instead-of-displaying-it-in-browser-with-htm
  2. https://www.w3schools.com/tags/att_a_download.asp

Last modified: 202107020531