I have a data uri in memory that I would like the user to download.
This fiddle works in chrome but not FF: http://jsfiddle.net/6W2TY/
When you click run it will download the tiny image in chrome and do nothing in FF. Can anyone help me understand why it doesn’t work in FF and what I need to do to make it work?
Thanks!
You are using the new (html5) download attribute.
As far as I know this is only supported in Chrome and not (yet) in Firefox.Update 3-2018
This feature is now supported in almost all major browsers (No IE support).
Alternative: Using location.href
Another way to force a download is to redirect the user to the image like this:
Or the short version
Alternative: Server Side
As an alternative, if you are processing the image serverside you can force a download by setting the content-disposition header.
PHP Example