0

I want to unzip a rar file with DotNetZip that have just one entry

 using (var zip = ZipFile.Read(zipFilePath))//Get exception here
  {
    foreach (ZipEntry ex in zip)
    ex.Extract(Path.GetDirectoryName(zipFilePath), ExtractExistingFileAction.OverwriteSilently);
   }

It's unzipe on a file with 5KB but gets me error on e file with 45MB size:

Cannot read that as a ZipFile in inner exceptin: Bad signature (0x21726152) at position 0x00000000

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) at ExtractFile(String zipFilePath, String tempDirectoryPath) in D:\Projects\MainForm.cs:line 212

I also tried to read from MemoryStream, a Suggestion that comes from this post

but it doesn't work.

Community
  • 1
  • 1
Mohammadreza
  • 3,139
  • 8
  • 35
  • 56

0 Answers0