Chrome Download Attribute Not Working

Chrome Download Attribute not working

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.

Source

HTTP-Header Content-Disposition

A hyperlink download attribute not working

it turns out, my problem is conflicted by same origin urls. Apprently, I am rquesting from different hosts/site, for further explanation see : https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy

Download attribute is not working on Chrome

Try this:

<a target="_blank" download="mylogo" href="san-francisco.jpg" title="ImageName">
<img alt="ImageName" src="san-francisco.jpg" width="104" height="142">
</a>

If it wasn't for this:

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.

Source

HTTP-Header Content-Disposition

download attribute doesn't working on chrome

<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, chrome gives priority to Content-Disposition.



Related Topics



Leave a reply



Submit