DEV Community

Paul Edward
Paul Edward

Posted on

inder — HTML Link <a> Download Attribute

Reminder — HTML Link Download Attribute

“download” is a thing on tags, download the file when clicking on a link instead of navigating to the file

You could even name the file to be downloaded by giving the download attribute a value.

The download attribute is actually new for HTML 5

There are no limit to the value you can allow, you can try it with the following extensions — .img .pdf .txt and so on

Although naming the file only works if it’s being downloaded from the same domain as the current page. Otherwise it uses the actual filename or a browser default if no name can be determined that is If the value is omitted, the original filename is used.

On a final note, I actually wish more browsers supports the download attributes , but you you can give it a short on the following browser version

Chrome: 14.0

Internet Explorer; 13.0

Mozilla: 20.0

Safari: 10.0

Opera: 15.0

This are the ones I know for now if there is an update or you have tried it on other version of indicate in the comment section

Enjoy!

Top comments (0)