Free Support Forum -

Save or Copy ZIP File Entries to MemoryStream Object of C# (.NET)

How do I save zip entries to memorystream?


You can build logic on the following simple code of Aspose.ZIP for .NET API that extracts/saves an entry into a MemoryStream object:

string dataDir = @"E:\Temp\";
using (FileStream fs = File.OpenRead(dataDir + ""))
    using (Archive archive = new Archive(fs))
        ArchiveEntry entry = archive.Entries[0];
        MemoryStream stream = new MemoryStream();
        entry.Open().CopyTo(stream); //This extracts the entry to a memory stream