How to download multiple files in single click

How to download multiple files in single click

how to download multiple files in single click

The solution · function downloadAll(files){ · if(files. length == 0) return; · file = files. pop(); · var theAnchor = $('') ·. attr('href', file[1]) ·. attr('download',file[0]);. How to Disable Multiple Automatic File Downloads. Fire up Chrome, click the menu icon, and then click “Settings.” Alternatively, you can type. code for download multiple file in single click in datalist. Hide Copy Code.

Downloading multiple files on a single button click

posted 7 years ago

Hi Ranchers,

I'm trying to achieve a functionality to download multiple files on a single button click. What I have done for now is that I've used a JQuery plugin that does this:

http://biesiad.github.com/multiDownload/



This seems to do just what was intended (triggering the click event for all links) and thereby starting the downloads. However, for every download initiated, it would open a 'Save as...' download box where I need to specify a location for this download.
Now, for a large number of files, this becomes a problem. Wondering if it would be possible to just ask for the download location for the first file and rest of the files in that batch get saved to the same location? (I understand this would be a security concern and most likely would not be possible).

Tweaking the browser settings would achieve something similar but it would not ask for the download location in the first place and would save in the default location specified.

Here's a summary of what is required:

1) User clicks on a link to download a batch of files.
2) The first download is initiated asking for a location to save the file.
3) All subsequent files are saved to the same location.

Any pointers in the right direction would be very helpful. I'll then try to take it forward from there.

Appreciate your time and inputs.

Источник: https://coderanch.com/t/607030/languages/Downloading-multiple-files-single-button