FTPweb request
-
Hi friends, i am using ftpwebrequest to upload files on ftp server here is my code. string uri = "ftp://myuserid:mypwd@ftp.shopzilla.com/myfile.txt"; FtpWebRequest reqFTP; reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(uri)); reqFTP.Proxy = null; reqFTP.Credentials = new NetworkCredential("myuserid", "mypwd"); reqFTP.KeepAlive = false; reqFTP.Method = WebRequestMethods.Ftp.UploadFile; reqFTP.UseBinary = true; reqFTP.ContentLength = fileInf.Length; int buffLength = 2048; byte[] buff = new byte[buffLength]; int contentLen; FileStream fs = fileInf.OpenRead(); try { Stream strm = reqFTP.GetRequestStream(); contentLen = fs.Read(buff, 0, buffLength); while (contentLen != 0) { strm.Write(buff, 0, contentLen); contentLen = fs.Read(buff, 0, buffLength); } strm.Close(); fs.Close(); } catch (WebException webEx) { WriteLog("Adding to Bizrate webex : " + webEx.Response.ToString()); WriteLog("Adding to Bizrate webex : " + webEx.Status.ToString()); WriteLog("Adding to Bizrate webex : " + webEx.Message); } catch (Exception ex) { WriteLog("Adding to Bizrate : " + ex.Message); } i am getting error The remote name could not be resolved: 'ftp.shopzilla.com' and status NameResolutionFailure please give me any solution or link to solve this Thanking you, Laxmikant Lad