C# Wanna BE

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top