Home  >  Article  >  Web Front-end  >  Detailed introduction and usage examples of HTML5 download attribute_html5 tutorial skills

Detailed introduction and usage examples of HTML5 download attribute_html5 tutorial skills

WBOY
WBOYOriginal
2016-05-16 15:48:052210browse

However, there are a lot of small, very nice features; one of them is the newly added download attribute. The download attribute allows us to specify that the browser uses a new file name when downloading, that is, renaming the downloaded file on the client side. Instead of the original file name on the link. In fact, a more appropriate name for the download attribute is downloadName.

HTML code

Put the download attribute on the A link…


Copy code
The code is as follows:

When the user clicks this link, the new name in the download attribute value will be displayed in the pop-up download box. The name of the file you save is "Budget Sheet.pdf". Moreover, the download attribute can force the download operation to be triggered, much like the operation we perform on the server side in PHP.

The download attribute is very useful when you need to perform a download task. Many times, the file names we store on the server are represented by serial numbers to ensure their uniqueness, but such names are meaningless to users. The client-side renaming function of the download attribute allows us to easily change the download file name.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn