Oct 16, 2013 at 2:02 PM
Edited Oct 16, 2013 at 2:03 PM
I have a zipped file on my server (created with this framework).
I have a windows mobile device.
I want to point to a url that will load that zip file on the server and retrun it as a stream.
Then I want to load that stream directly into a zipfile without writing to a disk.
I copied this from the sample code provided:
using (ZipFile zip = new ZipFile(_path))
On my client side I have this:
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("my url");
request.Method = "GET";
request.Timeout = 5000; // 5 seconds in milliseconds
request.ReadWriteTimeout = 20000; // allow up to 20 seconds
int nBlockLength = 1024;
int nBytesRead = 0;
MemoryStream ms = new MemoryStream();
using (Stream response = ((HttpWebResponse)request.GetResponse()).GetResponseStream())
buffer = new byte[nBlockLength];
nBytesRead = response.Read(buffer, 0, nBlockLength);
ms.Write(buffer, 0, nBytesRead);
while (nBytesRead > 0);
ZipFile = Ionic.Zip.ZipFile.Read(ms);
But on the last line it tells me of an error that it does not recignise this as a zip file.
What am i doing wrong pls?