Is it possible to download multiple files from an url into one created folder or as a zip?
I currently download a file given a url like so:
var download_url = "";
window.location.href = download_url;
If I were to have an array of urls, I could do something like...
for each url in urls
window.location.href = url;
This works, but will lead to individual downloaded files in the downloads folder. This can be messy.
Is it possible to create and specify which folder to download all of the files or convert all the downloaded files into a zip?
In modern browsers, you could convert all the downloaded files into a zip with a combination of JSZip (https://stuk.github.io/jszip/) and AJAX blob downloads (Using jQuery's ajax method to retrieve images as a blob), although I expect you will run into performance issues when dealing with large files. Otherwise, it isn't possible to create a folder on the client with browser JS.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With