Current behaviour:
If a user wants to download several files via the web interface, the user selectes several files and clicks on Download. Nextcloud now creates a ZIP file first and than offers to download this ZIP file.
This behaviour could cause a server memory problem/crash. If the server has a memory size of 2GB and the user is selecting files of a total bigger than the server memory, it just crashes because it exceeds the server memory during the zipping process.
Wanted behaviour:
If a user selects several files via the web interface and clicks on "Download", the browser should just start a download process for each file.
How could this be realised?:
Let the administrator chose with a on/off switch in the admin settings, whether a multiple file download is being zipped, or if the files are being downloaded separately.
Maybe this could also be administrated via user groups?
Would it be possible to implement this in one of the future releases?
I don't think that starting multiple downloads will work properly as browsers nowadays have lots of mechanisms to block multiple page opens happening though one click event.
Regarding the error, are there any log entries? Are you by any change on a 32bit system?
Hey @juliushaertl
To be honest I don't really have that problem, I just opened the request for a forum member who doesn't have a Github account. (https://help.nextcloud.com/t/disable-zipping/59279)
I forwarded your questions regarding possible log files and what system he is using.
Now that you mention the browser mechanism nowadays, I kind of agree that multiple downloads would probably cause issues.
The user should have the selection to download file seperately while admin has the right to allow it or not. for multi files, there could be a max parallel download file number before next batch
Now that you mention the browser mechanism nowadays, I kind of agree that multiple downloads would probably cause issues.
Besides causing issues i would not consider this as an expected behavior, a single click should trigger a single action and if the browser ends up with adding hundreds of files to the download queue this is probably more giving the feeling of a maleware attack than expected behavior. Also with individual downloads the structure of downloaded folders will be lost, so I don't see this being implemented.
@juliushaertl
I recently tried to backup large directory using zip download and it caused memory exhaustion.
This problem can be caused either by PHP trying to create zip file in memory or by the http server that tries to allocate entire response body or something similar.
Can you tell how the zipping process is implemented? Ideally file contents should be streamed to the client with minimal buffer allocated for transfer (nginx has support for this using some response header shenanigans, not sure about others). This is not happening in my case for some reason and I'm trying to find out why.
Meanwhile it seems that bandwidth control can't be implemented according to zip size as downloading this zip has unknown size
This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions.
Most helpful comment
Hey @juliushaertl
To be honest I don't really have that problem, I just opened the request for a forum member who doesn't have a Github account. (https://help.nextcloud.com/t/disable-zipping/59279)
I forwarded your questions regarding possible log files and what system he is using.
Now that you mention the browser mechanism nowadays, I kind of agree that multiple downloads would probably cause issues.