Comment: I have been paying close attention to the latest innovations in HTML5. Do you think I am wasting my time? HTML5 brings us a lot of "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 that the browser uses a new file name when downloading, that is, rename the download file on the client. Instead of the original file name on the link. In fact, the more appropriate name for the download attribute is downloadName.
HTML code
Put the download attribute on the A link...
<!-- Use the "budget table.pdf" name when downloading-->
<a href="/files/adlafjlxjewfasd89asd8f.pdf?66b11b" download="Budget Table.pdf">Download Expenditure Table</a>
When the user clicks on this link, the new name in the download attribute value will be displayed in the pop-up download box. In this way, the file name you save is budget table.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 download tasks. 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 renaming function of the download attribute makes it easy for us to change the download file name.