I'm trying to download and extract a zip file in C#, specifically DotNetZip.
When I run this code...
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(reportUrl);
HttpWebResponse response = (HttpWebResponse)webRequest.GetResponse();
Stream stream = response.GetResponseStream();
MemoryStream ms = new MemoryStream();
stream.CopyTo(ms);
ms.Seek(0, 0);
ZipInputStream zip = new ZipInputStream(ms);
zip.Seek(0, 0);
ZipEntry e = zip.GetNextEntry();
string s = e.FileName;
MemoryStream ms2 = new MemoryStream();
e.Extract(ms2);
After the Extract method executes, I get...
$exception {"Object reference not set to an instance of an object."} System.Exception {System.NullReferenceException}
Any thoughts? Thanks!