+1 vote
by (8.4k points)
edited

Is there a way, using Rebex ZIP, to decompress an entire folder (hopefully all at once).

Applies to: Rebex ZIP

1 Answer

+1 vote
by (8.4k points)
edited
 
Best answer

In case you want to extract all content of ZIP file:

// will extract whole content of myarchivive.zip to c:\temp\out\
ZipArchive.ExtractAll(
  @"c:\Temp\myarchive.zip", 
  @"c:\temp\out\",
  ArchiveActionOnExistingFile.OverwriteAll);

If you need to extract one folder from the ZIP archive and leave other folders intact try following code:

// will extract folder "first" from zip archive myarchive.zip 
// to c:\temp\out\ directory
ZipArchive.Extract(
    @"c:\temp\myarchive.zip",
    @"\first",
    @"C:\temp\out\",
    ArchiveTraversalMode.Recursive, 
    ArchiveActionOnExistingFile.OverwriteAll);
...