How to unzip an archive in Nextcloud

Hello everyone,

I want to import files from my PC into Nextcloud.
For that I created a zip archive of my files, that I uploaded in Nextcloud (version 24.x.x)

I wanted to know how to unzip this archive in Nextcloud.

Thanks for your help.

2 Likes

There is an app forthat. Search for it in the apps.

1 Like

The name of the app is Extract. Maybe you must install additional software on your server. Read this.

2 Likes

Yes. That was the one. I was in a hurry, so did not have time to find the excact app. :slight_smile: I even use it myself. However it is untested if on newest release, so use by your own risk.

However this requires “only” php-zip which can be installed through apt-get:
https://apps.nextcloud.com/apps/files_archive

2 Likes

Thanks,
Works fine :slight_smile:

Well, neither “Extract” nor “Archive Manager” can be installed as “requires Server version 28 or lower”.
Isn’t there an actually working App to extract Zip archives within in the Nextcloud?

It’s really a poor testimony that a simple ZIP function is not available by default in Nextcloud Files. Perhaps someone who is programming the app is reading along. There are zip functions for php.

But you can upload the files unzipped e.g. via scp and then

sudo -u www-data php /path/to/nextcloud/occ files:scan --all

execute.

thx, but we want to grant other users the opportunity to upload ZIPs – and to extract them if necessary without downloading them…

I found the apps Archive Manager (till Nextcloud 29, not tested) and Zipper (only zip not unzip).

Strange. It’s all very simple at Tiny File Manager. There is also an upload from URL like the app Transfer (till Nextcloud 28).

thx, but I don’t find any info about Tiny File Manager, e.g. if it’s running on NC 30.0.1…

Zipper also zips files. At elast I can choose any number of files and select more (the three dits) → Compress to zip when it is installed.

Yes. But Zipper can not unzip a zip-file in the cloud.

1 Like

I have create an issue for native zip/unzip-integration in Nextcloud Files. Maybe you can like the issue.

Note:
To zip and download files, simply select the files and download them. When downloading, you will always receive a zip file. So at least zip already seems to be included in Nextcloud. :wink:

2 Likes

Yeah. There is already included the needed PHP modules in the minimum required ones. So this should be a low hanging fruit. However this is easy for us to say, when none of us can code hence is not developing this ourselves. :upside_down_face:

1 Like

That would certainly be a nice feature, but I think it’s something that needs to be implemented very carefully, especially if you also want it to be able to extract archives on the server, because with archive files you can do a lot of nasty shenanigans that can cause all sorts of problems, including security issues.

1 Like

Yes. Because of that i wrote in the issue that maybe there could be a configuration entry e.g. in config.php. But I think at least for home users the security risk would be acceptable. Besides, Christmas is coming soon.

2 Likes

A home user would probably also click on a zip bomb that would steal all the inodes or fill the entire disc space, which would probably be one of the least bad things that could happen on a public facing server. :wink:

But yeah, I agree, as long as it is implemented carefully and/or can be disabled, it would certainly be a nice addition. :slight_smile:

1 Like

This may be the case with a zip file received by email from a third party. But first upload the zip file to Nextcloud and unzip it there. I don’t know if that’s a bigger risk. Normally i only upload files to my Nextclouds i really know. And mostly i first zip them on my linux client.

It might be a bit more problematic if you get the zip file via Nextcloud federation. But even there you usually know the sender and malicious code via Nextcloud Federation is far less likely than via email.

1 Like

Yes, you and me would probably use it like that. And if everyone was so careful, only a fraction of all cybersecurity incidents would happen :wink:

However, if they’re going to add it to the core, it has to be as secure as possible, and therefore tested thoroughly, because of course you can’t assume that once it’s an official feature, everyone will just use it for their own zip files. If it’s in there, people will use it for everything, especially people who don’t know anything about the potential risks.

So my statement was more related to another statement in this thread, which was that the php (un)zip functionality already exists in PHP, and therefore it should be easy to implement.

And yes, that’s probably true, and an experienced web developer could hack something like that toghether in a couple of hours. But would such an implementation be secure, and if not, how much effort would it take to make it secure?

I cannot really answer these questions as I am not a developer.

1 Like

Thx, well: I’d like to grant my client the opportunity to upload ZIPs to Nextcloud and then unpack / unzip it on the server…

Plus: Client writes that all his dates (creation date and change date) are set to uploading date, which brings another confusion. We’d like to test if uploading a ZIP, unzipping it in the Nextcloud, would show files with original date-time-code…

Or is there any other way to have that?