mhanley00
mhanley00

Reputation: 729

Allow Multiple File Downloads in Safari

I have an app that allows users to download two generated csv files when clicking one button. This feature works fine in Mac/Windows/Chrome, Mac/Windows/Firefox, and in Windows/Edge as long as the browser settings are set to allow multiple downloads.

For Safari, I can only get the first csv that gets generated to download. I have tried adding the site to the list of sites that are allowed to download files( ie https://9to5mac.com/2020/01/03/mac-how-to-always-allow-downloads-safari/) but it will not download the second file. Zipping the files together is an option but there's got to be a way to allow for multiple downloads in Safari somewhere.

Upvotes: 6

Views: 7427

Answers (1)

Aaron McGuire
Aaron McGuire

Reputation: 1255

I had the exact same issue, it worked in all other browsers except Safari. The solution that I ended up going with was to add a delay in between downloading each file. ( certainly not the nicest of solutions )

In my case i was using a javascript function to dynamically generate and trigger a click on a download button ( a common method to allow you to name your csv file )

Safari didn't like that the button was being pressed more than one time a second, it registered that the data was there and everything had updated but it only ever triggered the last download, setting a delay between file downloads allowed enough time for Safari to process that there should be multiple files downloaded.

Upvotes: 8

Related Questions