Chrome Download Attribute not working
I've experienced some unexpected behavior of Chrome since the newest version: While in Firefox this Code is working Perfectly fine:
<a id="playlist" class="button" download="Name.xspf" href="data:application/octet-stream;base64,PD94ANDSOON" style="display: inline;">Download Me</a>
It isn't working in Chrome (Simply downloading a file named "Download"), but has worked pretty fine before. What do I have to change that it is working again?
After some research I have finally found your problem.
<a> download attribute:
If the HTTP header Content-Disposition: is present and gives a different filename than this attribute, the HTTP header has priority over this attribute.
If this attribute is present and Content-Disposition: is set to inline, Firefox gives priority to Content-Disposition, like for the filename case, while Chrome gives priority to the download attribute.
Not work html5 a tag href download attr., For me it works fine in Chrome 70 for me, but you could try adding target="_blank" to the link as a fallback. I got the information and tested it from But somehow, the downloaded file is named as download without extension in Chrome v35.0.1916.114 , one workaround was to change data:application/csv to data:text/csv, but that only helped in getting the extension correct in the downloaded file i.e. it now downloads as download.csv. The issue with the download attribute still remains.
Reading the comments, I had the same issue as @buffer-overflow and found this in the issue:
I'm guessing that the web page and the download are on different origins. We no longer honor the download attribute suggested filename for cross origin requests. Clicking on the link still initiates a download. But the the filename is only derived from factors solely dependent on the server (e.g. Content-Disposition header in the response and the URL).
So no chance I could make it work ... :(
Download attribute not working properly : HTML, The problem I got is, that the file I want to be renamed using the download that this attribute is not supported in some browsers, but I tested Chrome and Opera. On NW.JS 0.24, when you click on the link, the downloaded file is called "crappyname.mp3", behaving like the download attribute is ignored, which is incorrect :/. I tried everything, the only way is to use the NW.JS SDK version and to right click on the link and choose "Download link".
This can be resolved by adding
target="_blank" attribute to the
Save sprites.svg as <a target="_blank" download="somefilename.svg" href="https://cdn.sstatic.net/Img/unified/sprites.svg" >somefilename.svg</a>
Downloading resources in HTML5: a[download] | Web, Engineer @ Google working on web tooling: Headless Chrome, Puppeteer, Lighthouse. Chrome now supports the HTML spec's new download attribute to a If this attribute is present and Content-Disposition: is set to inline, Firefox gives priority to Content-Disposition, like for the filename case, while Chrome gives priority to the download attribute. This attribute is only honored for links to resources with the same-origin. It's not from the same-origin, therefore it won't work.
I have a simple solution regarding this issue. You just need to put your html file into a server like Apache using xampp control and so on. Because the download attribute is properly working through a server.
<a download href="data:application/octet-stream;base64,PD94ANDSOON">Download Me</a>
Quick Tip: Using the HTML5 Download Attribute, While downloading cross-origin files is allowed in Chrome and the latest The download attribute has not yet been implemented in (as you HTML Custom Attributes Not Working in Chrome. Ask Question Asked IE is about the only browser I've seen that honor attributes that do not conform to the HTML DTD
Go To Chrome Click on "Settings" and you'll see a new page pop up in your Chrome browser window. Scroll down to Advanced Settings, find the Downloads group, and clear your Auto Open options. Next time you download an item, it will be saved instead of opened automatically.
Using The Anchor Tag href And download Attributes To Force A File , There's not really too much to this "download" attribute. The "download" attribute has very good support, working in all the While you used to be able to navigate a user to a Data URI, the Chrome browser is starting to block In Google Chrome if you click on Download link Save dialog is shown for all above documents. In Mozilla Firefox for docx and xls works fine, Save dialog is shown but for .png and .jpg download tag is not working as expected i.e., download dialog or Save dialog does not appear, it directly open that image. My code:
<a> "download" attribute doesn't seem to work · Issue #6094 · nwjs , Issues meet the checklist above will be processed before those don't. On Chrome, when you click on the link, the downloaded file is called Download attribute on A tag not working in IE actually be in the DOM for the download attribute to work, whereas Chrome, for example, does not. supporting the
HTML5 Download Attribute Guide | How it Works, At the time of writing, the latest versions of the following web browsers implement the download attribute: Firefox/Firefox for Android; Chrome/Chrome for Android If your site is hosted with a free service like WordPress.com, Blogspot, or perhaps Github pages which don’t allow you to do so, consider using the download attribute. Using the HTML5 Download Attribute. The download attribute is part of the HTML5 spec and expresses a link as download link rather than a navigational link.
HTML5 Download Attribute, A Look Into: HTML5 Download Attribute But some file types pose a technical problem – PDF, image and text files will open in slow to catch up – it's currently only supported on Firefox 20+, Chrome 14.0 and Opera 15.0. In my opinion it doesn't make any sense to link it with the CORS Policy, because I don't see which security flaws the hackers could exploit with the HTML5 download attribute. Also, cross origin downloads are working perfectly in Google Chrome.