server icon indicating copy to clipboard operation
server copied to clipboard

Admin option to disable creation of ZIP archives

Open h-2 opened this issue 2 years ago • 4 comments

How to use GitHub

  • Please use the 👍 reaction to show that you are interested into the same feature.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Is your feature request related to a problem? Please describe.

If a user of my instance requests the download of a folder, the server will attempt to create a ZIP file. If the folder is large, creating the ZIP file can create a significant computational burden on the server, in the worst case making the instance unusable for everyone. Since there is no visual indication of what is happening, the user doesn't even know that the server is actively zipping and will refresh and/or try to download again, which will create even more strain on the server. (The latter is a different problem, but it certainly makes this one worse).

Describe the solution you'd like

Add a check box for the admin:

  • [ ] Disable creation of ZIP files from folders that are larger than ___ MB (0 prevents any ZIP files from being created).

Whenever a user clicks Download on a folder for which ZIP file creation is disabled, they should be shown a dialogue that suggests using a WebDAV client instead. This can conveniently link to: https://docs.nextcloud.com/server/latest/user_manual/en/files/access_webdav.html

Describe alternatives you've considered

none

Additional context

Here is a help thread on the matter: https://help.nextcloud.com/t/disable-zipping/59279/26

Here is an outdated older issue (it could not be re-opened although there is activity on it) : https://github.com/nextcloud/server/issues/16971

h-2 avatar Aug 28 '22 22:08 h-2

I would like to have this option because i've downloaded ~7 gb of data but i don't have space to actually un-compress it.

rebirth90 avatar Oct 21 '22 20:10 rebirth90

My problem is that if the download is canceled (on a 20gb folder) the stream will continue.

On a light processor it is very consumer

A temporary solution I did is to block "addDirRecursive" function in Streamer.php. Waiting for a real patch

For different reasons, having the possibility to deactivate would be interesting

sfonteneau avatar Jan 20 '23 21:01 sfonteneau

I'd love the ability to do this. When transferring large datasets between outside collaborators and us, it can be very time consuming having to decompress an already compressed binary dataset. We're talking 100GB+. A flag or toggle switch of some kind would be glorious. Please seriously look at this issue. Thank you.

IPFR33LY avatar Feb 05 '23 15:02 IPFR33LY

We have issues with signatures in .pdf files. When they get zipped by Nextcloud some files are missing signatures. If we download them one by one the files are OK. It's a lot of work to explain to users that if they need to download several pdf files they have to do it one by one. And if we zip the files in windows, there are no issues.

digitalrevisor avatar Jun 13 '23 12:06 digitalrevisor

Perhaps you'd all find this helpful:

https://github.com/nextcloud/files_zip

Create zip archives from one or multiple files from within Nextcloud. The archive will be created in the background during cron job execution, so make sure that you have setup a regular cron job. Once the file has been created, the user will be notified about that.

It even supports configuring the maximum size of zip files.

joshtrichards avatar Jul 07 '23 14:07 joshtrichards

srsly - its still not possible to disable zip-creation of (already compressed) mp4-family movies to download in batch mode?

fred0r avatar Jul 18 '23 05:07 fred0r

Perhaps you'd all find this helpful:

But this doesn't prevent the normal way ZIP-files are created, correct?

srsly - its still not possible to disable zip-creation of (already compressed) mp4-family movies to download in batch mode?

To be honest, I am also a bit disappointed that this is in "Needs Triage" since almost a year although it has gotten quite a few thumbs-up. I guess this happens when Open Source projects become "too big" 😢

h-2 avatar Jul 18 '23 13:07 h-2

@h-2 wrote:

But this doesn't prevent the normal way ZIP-files are created, correct?

If you mean it leaves the Download button in-place, correct.

srsly - its still not possible to disable zip-creation of (already compressed) mp4-family movies to download in batch mode?

To be honest, I am also a bit disappointed that this is in "Needs Triage" since almost a year although it has gotten quite a few thumbs-up. I guess this happens when Open Source projects become "too big" cry

Nah, it comes up when 20+ people give it a thumbs up, but not one bothers to attempt a PR to explore implementation approaches. :-)

This is a community project. Anyone is welcome to try their hand at using fileMultiSelectMenu.toggleItemVisibility() to turn off the download item if the files_zip app (or item) is active. Then to extend that to, perhaps, an app setting in files_zip that makes it configurable behavior via getAppValue(). If you can't do that then you be patient and cross your fingers - or you learn how - or you pay someone to do it for you. Certainly no worse than non-open-source software, and even better in terms of being empowered to do something about it - if you so choose.

Or if someone just wants to get back to the core request of this particular Issue's enhancement request - it'd probably be even easier to add a config value to disable the Download action outright (with or without the files_zip app). It's not hard to imagine that could then be extended to supporting "disabling if over X MB/GB in size" etc.

Of course to get this accepted someone needs to think though any blow back that arises from making each of these seemingly tiny adjustments. e.g. Where might the Download action be a necessity? Where might fallback behavior be necessary? etc. etc.

Implementation hints

Toggling items:

https://github.com/nextcloud/server/blob/aa5dcb095256d6352de758361798de86c3e2d0d0/apps/files/js/filelist.js#L3490-L3501

https://github.com/nextcloud/files_zip/blob/8e97984803ba8b38d4046157b84ea1afa42a8011/src/main.js#L67-L73

Configuration:

https://github.com/nextcloud/files_zip/blob/8e97984803ba8b38d4046157b84ea1afa42a8011/lib/Service/ZipService.php#L162

https://docs.nextcloud.com/server/latest/developer_manual/basics/storage/configuration.html?highlight=getappvalue#app-values

joshtrichards avatar Jul 18 '23 15:07 joshtrichards

Certainly no worse than non-open-source software, and even better in terms of being empowered to do something about it - if you so choose.

Yeah, I am not bashing open source. Closed source could certainly be worse. I was saying that it is hard to scale responsiveness, user interaction etc that are often really good for small open source projects that only receive one issue per week or per month.

This is a community project. Anyone is welcome to try their hand at using

I think "Needs triage" is entirely different from "We have seen this issue, think the proposed solution is viable, but don't have resources to implement it. Please open a pull-request. The following links might be helpful: …"

If someone had said the latter, maybe there would have been a PR. But you can't expect someone who doesn't know anything about the project structure, the workflows, or even the involved programming languages to start reading up on all that and implement a solution without even knowing whether the project wants one?

Anyway. This is getting Offtopic. I am willing to put a 50€ bounty on the solution I proposed in the first post. I know that accounting for all developer time, it will likely cost more, but that's what it's worth to me.

h-2 avatar Jul 19 '23 15:07 h-2

I think "Needs triage" is entirely different from "We have seen this issue, think the proposed solution is viable, but don't have resources to implement it. Please open a pull-request. The following links might be helpful: …"

Yes, but "we" is "we". And you're putting a lot of importance on an arbitrary tag on an open issue.

If someone had said the latter, maybe there would have been a PR. But you can't expect someone who doesn't know anything about the project structure, the workflows, or even the involved programming languages to start reading up on all that and implement a solution without even knowing whether the project wants one?

People work issues in all sorts of states all the time. People submit PRs all the time without discussion ahead of time. Some get in and some don't. Some quickly... some years later. People experiment with different implementation approaches. Debate things openly. etc. That's how it works.

In any case, I just did what you asked by providing some hints. Let's see what happens. :-)

P.S. There are also loads of other ways to help the project which free up developer time. For example, helping triage Issues... :-)

P.P.S. Don't get me wrong - I understand and empathize with you: it can be frustrating when encountering an annoying bug or missing feature gap in a piece of software used every day.

joshtrichards avatar Jul 19 '23 17:07 joshtrichards

Compression does not reduce the size of image music and video files. I would also like to be able to disable md5 or whatever "check sum" NC is using. I really don't need that level of security, it just slows things down and I have seen multiple instances of check sum failure on large file.

bretthl avatar Oct 05 '23 11:10 bretthl