FtpWebRequest request = (FtpWebRequest)WebRequest.Create(FTPFullPath +"\\"+ Path.GetFileName(Renamefiles[i])); request.Method = WebRequestMethods.Ftp.UploadFile; request.Credentials = newnetworkCredential(myftpcreds.UserName,myftpcreds.Password); byte[] filecontents;//unable to read bytes using (StreamReader sourceStream = new StreamReader(Renamefiles[i])) { filecontents = Encoding.UTF8.GetBytes(sourceStream.ReadToEnd()); } request.ContentLength = filecontents.Length; using (Stream requestStream = request.GetRequestStream()) { requestStream.Write(filecontents, 0, filecontents.Length); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)