.NET Ionic.Zip : Compressed or Uncompressed size, or offset exceeds the maximum value

最后都变了- 提交于 2019-12-03 12:33:56

The solution revolves around not paying attention to zip file size limitations.

When using DotNetZip to zip large size files you will get errors like the following in your asp.net coding:

  1. There is not enough space on the disk
  2. Compressed or Uncompressed size, or offset exceeds the maximum value. Consider setting the UseZip64WhenSaving property on the ZipFile instance

When you see these errors it is probably a good idea to change your asp code by adding the line:

[yourZipReference].UseZip64WhenSaving = Zip64Option.Always

This will change your code to save the file in the zip64 format, so you may want to make a filesize check before making this change.

There is another line:

[yourZipReference].CompressionMethod = CompressionMethod.BZip2;// or CompressionMethod.Deflate or CompressionMethod.None

That will cause the module to use the zip compression method that is appropriate for the situation, but I haven't tested this one yet.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!