I have a live URL I want to download images without saving it. I also want to upload an image to another live URL. I want to code this using thread or socket programing. How do I save image file from one server to another server without saving it to local?
Asked
Active
Viewed 525 times
-1
-
what do you mean with without saving ... where you dont want to save? – Devjosh Apr 28 '12 at 07:26
-
He means save it from one server to another – RvdK Apr 28 '12 at 07:28
-
See http://stackoverflow.com/questions/256526/asp-net-image-uploading-from-url and http://stackoverflow.com/questions/5596747/download-stream-file-from-url-asp-net – Vano Maisuradze Apr 28 '12 at 07:50
-
Must be more clear what you ask, with a sample of what you have try. Now the question is too fuzzy. – Aristos Apr 28 '12 at 07:52
2 Answers
1
Download to a MemoryStream, rewind the stream, and upload the stream's content to the second site. See http://odetocode.com/Blogs/scott/archive/2004/10/05/webrequest-and-binary-data.aspx

robrich
- 13,017
- 7
- 36
- 63
0
This would definitely helps u,
byte[] imgcontent;
//Convert live images into byte array to pass it for ftp server
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
WebResponse response = request.GetResponse();
Stream stream = response.GetResponseStream();

Imran
- 53
- 2
- 11