Page 1 of 1

download lare zip files

Posted: 06 Dec 2021, 18:02
by Rowan
Thank you for the nice code. This is exactly what i needed!
It looks smooth and runs fine. 

I'm only facing problems with dowloading large photoalbums. Because the times it needs to zip the files and make it a downloadable it can look like nothing happens when clicking the download button. Unpatient people are clicking the download button a couple more times and the file will be downloaded multiple times.

I enabled the disabled the custom code but that didnt solve te problem.
Code
// download_dir cache direct access to zip / better caching and no need to access PHP / only works when download_dir_cache === 'dir'
Any idea how i can make a loading modal or an other option to inform the user the file is "loading"?

Re: download lare zip files

Posted: 07 Dec 2021, 05:02
by mjau-mjau
Good question, and I noticed the issue with slowness myself. One question though: Surely it downloads much faster after the _files.zip cache file gets created for each dir after first download? That is after all the crucial point of zip file caching.

As for some "loading modal", I was looking into this myself, but there simply is no real solution that detects from when a user clicks a button, until a file starts downloading. There is another solution using Javascript downloads API that could detect download-progress, but I don't feel confident about this solution as it downloads potentially massive files to browser (Javascript) before serving them to client.

Did you consider solution 'download_dir' => 'files'?  This provides instant multi-file downloading without zip, but it only seems to work in desktop. In my opinion, when it works (eg desktop), this is a neat solution.

Re: download lare zip files

Posted: 12 Feb 2022, 23:49
by mjau-mjau
Since Files 0.4.0 release, folder ZIP downloads are managed by Javascript, and will display status and progress of the download.