Images will not upload on web server but ok on local
<p>I have some images on server i want to upload it on another server i make code to upload all images on server but it is OK to upload on local but i didn't know what is wrong in that it can't be upload on server </p>

<pre><code>      try
        {
            byte[] content;
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
            WebResponse response = request.GetResponse();

            Stream stream = response.GetResponseStream();

            using (BinaryReader br = new BinaryReader(stream))
            {
                content = br.ReadBytes(500000);
                br.Close();
            }
            response.Close();

            string CompleteDPath = "ftp path";
            string UName = "abc";
            string PWD = "123";



            WebRequest reqObj = WebRequest.Create(CompleteDPath + file_name);
            reqObj.Method = WebRequestMethods.Ftp.UploadFile;
            reqObj.Credentials = new NetworkCredential(UName, PWD);
            reqObj.GetRequestStream().Write(content, 0, content.Length);
            reqObj = null;



            //FileStream fs = new FileStream(file_name, FileMode.Create);
            //BinaryWriter bw = new BinaryWriter(fs);

            //bw.Write(content);
            //fs.Close();
            //bw.Close();
        }
        catch (Exception ex)
        {
            Response.Write(ex.Message);
        }
</code></pre>
