Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FtpWebRequest request =
- (FtpWebRequest)WebRequest.Create("ftp://ftp.example.com/remote/path/file.zip");
- request.Credentials = new NetworkCredential("username", "password");
- request.Method = WebRequestMethods.Ftp.UploadFile;
- using (Stream fileStream = File.OpenRead(csvfilestring))
- using (Stream ftpStream = request.GetRequestStream())
- {
- fileStream.CopyTo(ftpStream);
- }
Add Comment
Please, Sign In to add comment