-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,741
  • 6
  • 40
  • 53
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
  • 12,789
  • 6
  • 33
  • 59
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
  • 10