0

I have a Stream that i want to read and then zip it,

This stream is generated by HttpRequestMessage in web api as posting a zip file through restclient and code as below

var task = this.Request.Content.ReadAsStreamAsync();
            task.Wait();    
                           using (Stream requestStream = task.Result)
                {  }

using DotNetZip i need to convert this requeststream to zip file ?

Waiting for your comments

GowthamanSS
  • 1,434
  • 4
  • 33
  • 58
  • what is the question here exactly? you already have the stream and all you need is to check the capability of DotNetZip to see if it accepts a stream directly and creates a zip file out of it. BTW, you can use async-await to improve your code `await Request.Content.ReadAsStreamAsync();` – Kiran Jan 10 '14 at 18:59
  • @KiranChallan i have uploaded a zip file in rest client i need to download as such in through above code – GowthamanSS Jan 13 '14 at 05:47
  • 1
    Have you looked at the following post? http://stackoverflow.com/a/9549889/1184056 – Kiran Jan 13 '14 at 05:54
  • @KiranChalla not yet will check and update u – GowthamanSS Jan 13 '14 at 10:16
  • @KiranChalla have this works for zip file – GowthamanSS Jan 13 '14 at 10:22

0 Answers0