Have you implemented the HTML5 DOWNLOAD attribute?

Creation & Innovation

Moderator: Moderators

Have you implemented the HTML5 DOWNLOAD attribute?

Postby finoy » Tue May 19, 2015 11:02 pm

As you know, there are some files that the browser doesn’t automatically download; images, other web pages and depending on the settings in your browser, sometimes even PDFs. The download attribute gives the browser a native way to download these files automatically.

Place the download attribute on a link...
Code: Select all
<a href="/files/9fd-f32ff322.pdf" download="expenses.pdf">Download Your Expense Report</a>

...and when the user clicks the link, the download attribute appears in the save dialog instead of the garbled mess that was there before. In this case, the file will be downloaded as expenses.pdf.
Demo

Browser support
Currently, only Chrome 14+ and Firefox 20+ support the download attribute.
Internet Explorer does not presently support the Download attribute on A tags. :(

See http://caniuse.com/download and http://status.modern.ie/adownloadattribute; the latter indicates that the feature is "Under consideration" for IE12.
finoy
 
Posts: 14
Joined: Thu Jun 21, 2012 10:34 pm
Tell us why you would like to become a WyseLabs Member: am the part of this website. :)

Return to Web Design

Who is online

Users browsing this forum: No registered users and 2 guests

cron