DEV Community

Cover image for Have you heard of the download html attribute?
Maciej Trzciński 🌱🇵🇱
Maciej Trzciński 🌱🇵🇱

Posted on

Have you heard of the download html attribute?

The download attribute specifies that the target will be downloaded after a user clicks.
Also, when you set value to download, the file after download will have this name, in my particular example the file will named Awesome-Company.pdf after download.

/**
*  download - this is information for breowser that the link will download file
*  value - here you can set name for file
**/
<a href="/uploads/company-info.pdf" download="Awesome-Company" />

Enter fullscreen mode Exit fullscreen mode

If you like this article, follow me on Twitter @MaciejDEV

Top comments (0)