How to download a file using href - were
How TO - Download Link
Learn how to create a download link with HTML.
Download Link
You can use the HTML attribute to specify that the target will be downloaded when a user clicks on the hyperlink.
Example
<img src="/images/diseinuak4web.net" alt="W3Schools">
</a>
The attribute is only used if the attribute is set.
The value of the attribute will be the name of the downloaded file. There are no restrictions on allowed values, and the browser will automatically detect the correct file extension and add it to the file (.img, .pdf, .txt, .html, etc.).
You can also specify a value for the download attribute, which will be the new filename of the downloaded file. If the value is omitted, the original filename is used.
Example
Specify a value for the download attribute, which will be the new filename of the downloaded file ("diseinuak4web.net" instead of "diseinuak4web.net"):
<img src="/images/diseinuak4web.net" alt="W3Schools">
</a>
Browser Support
The numbers in the table specify the first browser version that fully supports the attribute.
Attribute | |||||
---|---|---|---|---|---|
download |

-
-