Skip to content

Setting ZipStreaner zip64 = true#15367

Closed
alogoc wants to merge 1 commit intonextcloud:masterfrom
alogoc:master
Closed

Setting ZipStreaner zip64 = true#15367
alogoc wants to merge 1 commit intonextcloud:masterfrom
alogoc:master

Conversation

@alogoc
Copy link

@alogoc alogoc commented May 3, 2019

Downloaded zip files larger than 4GB are corrupted. In my case setting "new ZipStreamer(['zip64' => true])" fixed the issue and I believe that this should be the default now since the zip64 issues on older nextcloud versions have been fixed.

Downloaded zip files larger than 4GB are corrupted. In my case setting  "new ZipStreamer(['zip64' => true])" fixed the issue and I believe that should be the default since the zip64 issues on older nextcloud versions have been fixed.

Signed-off-by: alogoc  <george.taranis@gmail.com>
Signed-off-by: Interoute <alogoc@mail.taranis.gr>
@ChristophWurst
Copy link
Member

Ref #7972 @rullzer

@Acreen
Copy link

Acreen commented Jul 9, 2019

I'm really wondering how that fix could help with the problem.

if ($size < 4 * 1000 * 1000 * 1000 && $numberOfFiles < 65536) {
$this->streamerInstance = new ZipStreamer(['zip64' => true]);
} else if ($request->isUserAgent($this->preferTarFor)) {
$this->streamerInstance = new TarStreamer();
} else {
$this->streamerInstance = new ZipStreamer(['zip64' => PHP_INT_SIZE !== 4]);
}

If the file which is causing problems is larger than 4 GB it does not even enter the first if. Shoudln't the fix be in the last else statement? I tried it for me. The difference in behavior was, that it did not cancel the transfer but the zip I downloaded was corrupt. It had the correct size but it was unusable.

Just wondering as I read in older threads that larger files shouldn't be a problem for 32 bit os anymore. I'm using nextcloudpi.

@kesselb
Copy link
Contributor

kesselb commented Sep 28, 2019

If the file which is causing problems is larger than 4 GB it does not even enter the first if.

I agree with you. This pr would enable zip64 if the file is smaller than 4gb and has less than 65k files.

@kesselb kesselb closed this Sep 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants