How do I save zip entries to memorystream?
You can build logic on the following simple C# code of Aspose.ZIP for .NET API that extracts or saves an entry into a MemoryStream
object:
using Aspose.Zip;
using System.IO;
namespace ExtractZipFileToMemoryStream
{
class Program
{
static void Main(string[] args)
{
string dataDir = @"E:\Temp\";
License license = new License();
license.SetLicense(dataDir + "Aspose.ZIP.License.lic");
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
}
}
}
}
}