How do I save zip entries to memorystream?


#1

How do I save zip entries to memorystream?


#2

@salemantulsa,

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 + "test123.zip"))
{
    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
    }
}