Comments: I have been paying close attention to the latest HTML5 innovations. Do you think I am wasting my time? HTML5 brings us many "heavy" features, such as WebSockets, Web Workers, History, Storage, and some tool classes like classList.
However, there are also many small and very good features. One of them is the newly added download attribute. The download attribute allows us to specify a new file name for the browser to download, that is, rename the downloaded file on the client. Instead of the original file name on the link. In fact, the more appropriate name of the download attribute is downloadName.
HTML code
Put the download attribute on link ....
The Code is as follows:
<! -- Use the "budget table" name for download -->
<A href = "/files/adlafjlxjewfasd89asd8f.pdf? 66b11b "download =" budget table "> download expense fee </a>
When you click this link, the new name in the download property value is displayed in the pop-up download box. In this example, the saved file name is "budget table ". In addition, the download attribute can forcibly trigger the download operation, much like the operation we performed on the server using PHP.
The download attribute is very useful when you need to execute a download task. In many cases, the names of files stored on the server are represented by serial numbers to ensure their uniqueness, however, such a name is meaningless to the user. The client rename function of the download attribute makes it easy to change the download file name.