SOLVED: How to load a ZIP file from a byte[] array in C# using Xceed ZIP.NET

If you want to load a ZIP file in C# using Xceed ZIP.NET from a byte[] array you can do so easily by creating a MemoryStream and from there you create a StreamFile which can be loaded into the ZipArchive class.

using (MemoryStream stream = new MemoryStream(zipData))
{
    AbstractFile zipFile = new StreamFile(stream);
    ZipArchive zip = new ZipArchive(zipFile);
    AbstractFile[] files = zip.GetFiles(true);
}


 While you're here -
Why not check out our Group Policy Audit and Documentation Tool?


Comments