简体   繁体   English

在 C# 中提取 zip 文件时,拆分和跨越不支持错误

[英]split and spanned not support error while zip file extraction in c#

While Zip file Extraction using ziparchival class in C#.在 C# 中使用 ziparchival 类进行 Zip 文件提取。 It working fine for few files but files with size more than 1 GB it throwing "Split or spanned archives are not supported."它适用于少数文件,但文件大小超过 1 GB 时会抛出“不支持拆分或跨区存档”。 I dont get what it mean.我不明白这是什么意思。 How to resolve it?如何解决?

DotNetZip allows you to do this. DotNetZip允许您执行此操作。 From their documentation:从他们的文档:

The library supports zip passwords, Unicode, ZIP64, stream input and output, AES encryption, multiple compression levels, self-extracting archives, spanned archives, and more.该库支持 zip 密码、Unicode、ZIP64、流输入和输出、AES 加密、多个压缩级别、自解压档案、跨度档案等。

With Dotnetzip library you can zip even more than 4 gb.使用 Dotnetzip 库,您可以压缩甚至超过 4 GB。 Also a lot easer to use then working with filestreams and bytearrays.使用文件流和字节数组也更容易使用。

using (ZipFile zip = new ZipFile()) {
    zip.CompressionLevel = CompressionLevel.BestCompression;
    zip.UseZip64WhenSaving = Zip64Option.Always;
    zip.BufferSize = 65536*8; //buffer size

    foreach (var file in filenames) {
        zip.AddFile(file);
    }
    zip.Save(outpath);
}

当您尝试提取在复制过程中损坏的 Zip 文件时,我已经看到此错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM