读取70MB的Zip文件时出现错误(NuGet扩展名Ionic.Zip)

时间:2019-03-16 08:43:25

标签: c# nuget zip nuget-package

我能够使用相同的代码解压缩文件,但是对于65MB以上的文件,它会在 ZipFile.Read

中生成溢出错误。

我已经编写了代码:

using Ionic.Zip;

private void UnzipFile()
{
    using (ZipFile zip = ZipFile.Read(currentFilePath))
    {
        zip.ExtractAll(target_file_path, ExtractExistingFileAction.OverwriteSilently);
    }
}

但是出现溢出错误:

Ionic.Zip.ZipException
  HResult=0x80131500
  Message=Cannot read that as a ZipFile
  Source=Ionic.Zip
  StackTrace:
   at Ionic.Zip.ZipFile.ReadIntoInstance(ZipFile zf)
   at Ionic.Zip.ZipFile.Read(String fileName, TextWriter statusMessageWriter, Encoding encoding, EventHandler`1 readProgress)
   at Ionic.Zip.ZipFile.Read(String fileName)

Inner Exception 1:
OverflowException: overflow while creating filename

0 个答案:

没有答案