unzip and read zip file in memory

madtown_nihs

New member
Joined
Sep 30, 2011
Messages
1
Programming Experience
5-10
Hello Guys,

I am wondering if anyone has experience trying to unzip and read a zip file in memory without having to download the physical file and delete it afterwards.

Thanks,
madtown
 
Not specifically, but SharpZipLib is based on Streams, so you may well be able to use it with a NetworkStream obtained by calling GetResponseStream on a WebResponse, or on a MemoryStream created from a Byte array. Check out the SharpZipLib documentation and any examples you can find. Anywhere that accepts a Stream as a source, you can provide the aforementioned NetworkStream or MemoryStream. Streams are specifically designed such that you can use them all in basically the same way, regardless of where the other end is. Examples are likely to show a FileStream, but a Stream is a Stream.
 
Actually, DotNetZip is probably easier to use than SharpZipLib, as long as you only need to handle the ZIP format. I just had a quick look and found an example of using DotNetZip with a Stream:

DotNetZip Library

That Stream is for an embedded resource but, as I said, a Stream is a Stream.
 
Back
Top