Home > Web Front-end > H5 Tutorial > body text

Detailed introduction and usage examples of HTML5 download attribute_html5 tutorial skills

WBOY
Release: 2016-05-16 15:48:05
Original
2224 people have browsed it

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.

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template