Downloading multiple files all at once

I’m trying to figure out a way to download multiple images from my database with one button click. I’m able to create separate buttons/links to these images and able to individually download them. I’ve combed through a number of external sites to get examples, but none of them are producing any valid results.

I created a simple loop that creates a link for each image (in my database) and thought I could use wixLocation.to(‘url’) call, but it only downloads the last image in the loop. I thought that adding a wait time might help, since I figured that each request was not finishing up and therefore only the last one gets completed, so I used the setTimeout() function, but this does not appear to do anything?

Any suggestions on how I can do this? Thanks!

Hi All, I was able to make this work. What I did was create loop whereby the pause for each image download increased as part of the loop, allowing for previous image downloads to complete. It’s probably not the perfect solution, but it seems to work across 1 - n number of images. I used the setTimeout() function to make this work.

@pl993 Can you post your url and the code? I am looking to do something similar. Thank you!

Me too! Please share the solution

https://www.wix.com/velo/reference/wix-media-backend/mediamanager-obj/downloadfiles