I am using Website panel on an IIS server . I want to upload a file using ftp
I used this code :
try
{
WebClient webClient = new WebClient();
OpenFileDialog fd = new OpenFileDialog();
fd.ShowDialog();
MessageBox.Show(fd.FileName);
webClient.UploadFileTaskAsync(new Uri("ftp://" + "username" + ":" +"pass" +"@" + "address/" + "name.ext"), fd.FileName);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
This code runs without error . when I use file manager of website panel , A file created "Name.ext" but this file size is 0 KB. Why? What is my problem ?!
I am sure that windows firewall allow me to do it.
update : I am doing it with UploadFileTask and UploadFile (an unasync) but result is same as async :(