How to extract zipped file received from HttpWebResponse?

前端 未结 2 1218
温柔的废话
温柔的废话 2021-01-06 11:50

I put url to browser\'s address bar and it downloads the zip file to HD. The size of zipped file is 386 bytes as written in its properties.

When I use <

相关标签:
2条回答
  • 2021-01-06 12:06

    Give this a shot:

    var response = webRequest.GetResponse() as HttpWebResponse;
    var stream = response.GetResponseStream();
    var s = new ZipInputStream(stream);
    

    I believe you're very close and that you're using the right approach -- you can use this article to back that up -- their code is very similar.

    0 讨论(0)
  • 2021-01-06 12:16

    I'm using http://dotnetzip.codeplex.com/ I've not used it to download stuff, but to extract stuff that people upload to my server. I assume it should work perfectly the other way round too.

    I've tried the built-in zip from microsoft too, but also had issues. So I gave it up and switched.

    0 讨论(0)
提交回复
热议问题