tinyfilemanager icon indicating copy to clipboard operation
tinyfilemanager copied to clipboard

new feature select all download

Open BoneDeath opened this issue 3 years ago • 3 comments

Hi i love your project, and im developing your project to, im add new feature! Download all Selected file This feature support for all browser. screenshot

BoneDeath avatar Aug 09 '22 03:08 BoneDeath

I will happy if u using this code for your project!!


<button onClick="downloadAllSelected()">Download</button>

<script>
    function downloadAllSelected() {
        parent=$( "input:checked" ).closest("tr");
        child=parent.find("a[title=Download]");
        

        var a = child;
        for (var i=0, iLen=a.length; i<iLen; i++) {
        

            url = a[i].getAttribute("href");
            akhir = url.substring(url.lastIndexOf('/')+1);
            nama=akhir.substring(akhir.lastIndexOf('=')+1);


            if ('download' in a[i]) {
              a[i].download = nama;
            }
           
            if (a[i].click) {
              a[i].click(); 
            } else {
              $(a[i]).click();
            }
      }
    }
</script>

BoneDeath avatar Aug 09 '22 03:08 BoneDeath

Looks nice, maybe you should open a PR for this feature.

AgentSmith0 avatar Aug 10 '22 11:08 AgentSmith0

The above code doesnt function in my web-installation under Plesk in a subdomain....? Bit i have the similar problem that its zips(tar's) only one folder of x selected - can You expand this script so far please... (except that it zips big folders only partially - max 1.2GB - under plesk)

At https://github.com/g7sim/cmsimple-XH-CL/blob/master/cmsimple/userfuncs.php You find an GPL3 - Algorythm for recursive file-zip or also https://learncodeweb.com/php/select-and-download-multi-files-in-zip-format-with-php/

gtbu avatar Sep 09 '22 21:09 gtbu