Download csv files using Javascript on Safari

I created a CSV file using Javascript. When the user clicks on the link, the CSV file should be downloaded to their PC with the correct file name.

I'm using the HTML5 Download attribute in the tag to provide the filename, but Safari doesn't recognize this because I haven't implemented the Download function yet. This causes the download file to be named "Unknown".

Is there any other way to create a download while preserving the filename?

+3


source to share


1 answer


I ended up doing a quick research - it looks like Safari doesn't support what you're looking for.



The reason your answer works in Chrome (and Firefox) is because they support the download property - Safari doesn't exist yet. Safari 10.1+ supports the download attribute

0


source







All Articles