I am developing a wpf application and I want to create a directory on ftp using C # with different usernames, and if it already exists, save the files in an existing directory.
I successfully created the validation logic of an existing directory, but when creating a new directory, I have an exception at runtime:
The remote server returned an error: (550) File unavailable (eg, file not found, no access).
I have tested various solutions on the Internet, and most of them say that this is due to write permissions. I assign permissions to the ftp folder, but I still have a problem. Please, help?
Here is my code:
static void CreateFtpFolder(string source) { FtpWebRequest request = (FtpWebRequest)FtpWebRequest.Create(source); request.Credentials = new NetworkCredential(ftpusername, ftppassword); request.Method = WebRequestMethods.Ftp.MakeDirectory; request.UsePassive = true; request.UseBinary = false; request.KeepAlive = false; request.Proxy = null; FtpWebResponse ftpResp = request.GetResponse() as FtpWebResponse; }
I have an error on FtpWebResponse .
user2493843
source share