5

I was doing a project and I faced an issue with the attribute download: I discovered that it isn't supported by Safari browser (according to documentation).

Here's a snippet:

<!DOCTYPE html>
<html>
  <head>
  </head>
  <body>
    <a href="http://cdn.sstatic.net/Sites/stackoverflow/img/apple-touch-icon@2.png?v=73d79a89bded&a" download>Press to Download</a>
  </body>
</html>

I searched a way to do it with pure Javascript or Angular, but I didn't find nothing. Would be great if someone had a solution.

developer033
  • 24,267
  • 8
  • 82
  • 108
  • This has all of the ways: [How can I create download link in html?](http://stackoverflow.com/questions/2793751/how-can-i-create-download-link-in-html) – 4castle Aug 03 '16 at 20:39
  • No, it isn't duplicate. There is no answer to work with Safari browser. – developer033 Aug 03 '16 at 20:40
  • See [this answer](http://stackoverflow.com/a/2793756/5743988) or [this answer](http://stackoverflow.com/a/24694545/5743988) on that post. There isn't a way to do it with JavaScript. It requires editting the response headers. – 4castle Aug 03 '16 at 20:41

1 Answers1

-1

Try

<a href="http://cdn.sstatic.net/Sites/stackoverflow/img/"
   download="apple-touch-icon@2.png?v=73d79a89bded&a">
   Press to Download</a>
Herald Smit
  • 2,342
  • 1
  • 22
  • 28