html - HTML5 Download Attribute for image not working -
trying file downloaded , renamed "image.png", every time click on download button, file downloaded name: "leisa_christmas_false_color.png". appreciate help, thanks.
<a id="download" href="https://www.nasa.gov/sites/default/files/styles/image_card_4x3_ratio/public/thumbnails/image/leisa_christmas_false_color.png" download="image.png">download</a>
- firefox allows users download files of same origin due security concern. file must come own server or domain name, otherwise opened in browser.
- while downloading cross-origin files allowed in chrome , latest opera (with chromium/blink), both ignore attribute value. in other words, file name remain unchanged.
don't use extension '.png' in download attribute. can't change extension; automaticly added. btw not every browser support download attribute. more information take here: http://www.w3schools.com/tags/att_a_download.asp
Comments
Post a Comment