-1

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?

Shashank Kadne
  • 7,993
  • 6
  • 41
  • 54
Janhavi
  • 77
  • 1
  • 1
  • 4

2 Answers2

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