Reputation: 86
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?
Upvotes: 3
Views: 6960
Reputation: 1158
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
Upvotes: 1