Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting ZipStreaner zip64 = true #15367

Closed
wants to merge 1 commit into from
Closed

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.

None yet

5 participants