3

I have generated a CSV file using Javascript. When the user clicks a link, the CSV file has to be downloaded to his PC with a proper filename.

I am using HTML5 'Download' attribute in tag to provide the filename, but Safari does not acknowledge this as it has not implemented the 'Download' feature yet. This results in the download filename to be named as 'Unknown'.

Is there any other way to generate a download while retaining the filename?

Souji
  • 86
  • 1
  • 8
  • 1
    Use blobs. Check this question: [Download blobs locally using Safari](http://stackoverflow.com/questions/12802109/download-blobs-locally-using-safari) – hbrls Jan 24 '15 at 12:29
  • https://stackoverflow.com/questions/14964035/how-to-export-javascript-array-info-to-csv-on-client-side/14966131#14966131 – Quinn Keaveney Jul 03 '18 at 22:11

1 Answers1

1

I completed a quick research - I looks like Safari does not supports what you are looking to accomplish.

The reason behind why your answer works in Chrome (and Firefox) is that they bolster the download property - Safari doesn't yet. Safari 10.1+ supports "download" attribute