4

This fiddle is not working in firefox but working in chrome.

I have tried using this :

<p>Click on the w3schools logo to download the image:<p>

<a href="http://www.w3schools.com/images/myw3schoolsimage.jpg" download="aa">
  <img border="0" src="http://www.w3schools.com/images/myw3schoolsimage.jpg" alt="W3Schools" width="104" height="142">
    </a>

<p><b>Note:</b> The download attribute is not supported in IE, Safari or Opera version 12 (and earlier).</p>

Link to fiddle : JsFiddle

scytale
  • 12,346
  • 3
  • 32
  • 46
user3727204
  • 55
  • 1
  • 1
  • 6

1 Answers1

9

first of all in firefox, you cant mark an a element to download from another domain so an a like this wont work

    <a href="http://www.w3schools.com/images/myw3schoolsimage.jpg" download>

but this other will work on firefox

    <a href="img/book.png" download>

Firefox need to be from the same domain, so a relative url, will work fine.

:) goog luck

HadesDX
  • 158
  • 6
  • 4
    note that it should work on remote urls in FF if the server emits CORS headers. – dandavis May 25 '15 at 19:37
  • @dandavis I've added CORS headers, with * for origin, and I can see them coming back to the browser, but it has made no difference. – Antony Nov 21 '17 at 21:40
  • Searching around some more, found a confirmation that this is not possible with FF: https://stackoverflow.com/questions/28318017/html5-download-attribute-not-working-when-downloading-from-another-server-even – Antony Nov 21 '17 at 21:46
  • 2
    I just tested it, and it seems to be broken now in Firefox. – Jan-Luca Klees Apr 05 '22 at 11:14