try
{
FtpWebRequest ftp = (FtpWebRequest)FtpWebRequest.Create(ftpfullpath);
ftp.Credentials = new NetworkCredential(username, Password);
ftp.KeepAlive = true;
ftp.UseBinary = true;
ftp.Method = WebRequestMethods.Ftp.UploadFile;
FileStream fs = File.OpenRead(filepath);
byte[] buffer = new byte[fs.Length];
fs.Read(buffer, 0, buffer.Length);
fs.Close();
Stream ftpstream = ftp.GetRequestStream();
ftpstream.Write(buffer, 0, buffer.Length);
ftpstream.Close();
}
catch (Exception ex)
{
throw ex;
}
I really have no idea what I should do now, I searched through the Internet and couldn't find a way to fix the problem.
I am using System.Net
as well, so it shouldn't be a problem.
An unhandled exception of type 'System.Net.WebException' occurred in Project.exe Additional information: System Error.
Thanks for all the help!