Download and save file to server from a URL (HTTP)

M

Max

I need help in vb.net to download a binary file off another web site and
save to it to the server. Not from the client. Server to server. Can anyone
point me to the right classes to use at least? filestream.. one of the web
classes... ??

-Max
 
J

Joerg Jooss

Max said:
I need help in vb.net to download a binary file off another web site
and save to it to the server. Not from the client. Server to server.
Can anyone point me to the right classes to use at least?
filestream.. one of the web classes... ??

There is no such thing as server to server in HTTP. One participating server
will always act as a client from a logical POV. Check out
System.Net.WebClient or System.Net.WebRequest/WebResponse for advanced
applications.

Cheers,
 
M

Max

Thanks for the clearification. Amazingly the webclient class did the trick
with only one line of code! Wohoo!
---------------------------------
Dim client As New WebClient
Dim strURL As String = "http://www.someurl.com/sendfile.php?file=myfile.gz"
Dim strFilename As String = Server.MapPath("myfile.gz")

client.DownloadFile(strURL, strFilename)
----------------------------------
 

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

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top