Add a new feature download all selected files for tinyfilemanager
Hi, it would be great to add a button to download all selected files so you don't have to download them one by one

This code is no longer valid apparently, so this should either be adapted to current code or closed.
This code is no longer valid apparently, so this should either be adapted to current code or closed.
Hi Thanks for telling me, I just resolve to current code
This does not appear to work.
The first issue is that you placed the JavaScript function inside an if statement that only runs when in editor mode, so that would never work in the file list where it should, instead you get an error downloadSelected is not defined.
Then, even if you place the function somewhere appropriate, it still does not work. Instead, it just calls/clicks the download button for the last file you selected, which then triggers the confirmDailog download modal and after that you're stuck with the modal-backdrop in the foreground and can't interact with the file list anymore nor does it download more than 1 file.
Instead of using the download button, which triggers the modal and also has multiple hurdles (path and filenames with + symbol replacing spaces being one of them), it would be much easier to use the existing Direct Link object. This seems to work:
//download selectedFiles
function downloadSelected() {
parent = $("input:checked").closest("tr");
child = parent.find("a[title='<?php echo lng('DirectLink')?>']");
var a = child;
for (var i = 0, iLen = a.length; i < iLen; i++) {
a[i].setAttribute("download", "");
if (a[i].click) {
a[i].click();
} else {
$(a[i]).click();
}
a[i].removeAttribute("download");
}
}
P.S: The code still has to be placed outside the editor conditional if, you can for example, place it right after it closes:
https://github.com/prasathmani/tinyfilemanager/blob/eb8f3d80bcf27f93c5d9e800d60231b1617536b1/tinyfilemanager.php#L4217
<script>
//download selectedFiles
function downloadSelected() {