Hi
i have a url that if i paset it into IE it returns to me a zip file from a
remote server. it asks me where do i want to save it then creates the zip
file. the file contains the data that i have requested


I have created a desk top app that makes the same request to the same
remote server using and HTTPrequest when i get the response back. how i write
a zip file to my c Drive but it contains 0 bytes.

how do i extract the Zip file from my web response and save it to my
computer. thanks.

Re: C# Wanna BE by Morten

Morten
Wed Sep 20 00:41:32 CDT 2006

Hi Alvis,

You typically grab the ResponseStream from the HttpWebResponse (that you
get from HttpWebRequest.GetResponse()). The ResponseStream can be fed to
a FileStream and written to file.

Easier though is to use
WebClient.DownloadFile("http://www.someplane.com/file.zip", "C:\\file.zip")


On Wed, 20 Sep 2006 00:35:02 +0200, Alvis
<Alvis@discussions.microsoft.com> wrote:

> Hi
> i have a url that if i paset it into IE it returns to me a zip file from
> a
> remote server. it asks me where do i want to save it then creates the zip
> file. the file contains the data that i have requested
>
>
> I have created a desk top app that makes the same request to the same
> remote server using and HTTPrequest when i get the response back. how i
> write
> a zip file to my c Drive but it contains 0 bytes.
>
> how do i extract the Zip file from my web response and save it to my
> computer. thanks.



--
Happy Coding!
Morten Wennevik [C# MVP]