How to upload file to the ftp Server or Flash Media Server(Influxis) using c#
//First create FtpWebRequest object with the ftpURL
System.Net.FtpWebRequest ftpRequest = (System.Net.FtpWebRequest)System.Net.WebRequest.Create(CompleteFTPPath);
//Set the ftp Method, like 'UploadFile' for upload
ftpRequest.Method = System.Net.WebRequestMethods.Ftp.UploadFile;
//Give your user name & password of the ftp login
ftpRequest.Credentials = new System.Net.NetworkCredential("username", "password");
ftpRequest.UsePassive = false;
//read your local file with stream and save it in a buffer
System.IO.FileStream streamObj = System.IO.File.OpenRead(CompleteLocalPath);
byte[] buffer = new byte[Convert.ToInt32(streamObj.Length)];
streamObj.Read(buffer, 0, buffer.Length);
streamObj.Close();
streamObj = null;
//read your buffer and save it to the FTP Server
ftpRequest.GetRequestStream().Write(buffer, 0, buffer.Length);
ftpRequest = null;
1 Response to How to upload file to the ftp Server or Flash Media Server(Influxis) using c#
Hello. This post is likeable, and your blog is very interesting, congratulations :-). I will add in my blogroll =). If possible gives a last there on my blog, it is about the DVD e CD, I hope you enjoy. The address is http://dvd-e-cd.blogspot.com. A hug.
Something to say?