Reputation: 1358
I am trying to change the way my application is connected to a filezilla server after some changed from a security point of view.
at first it was just added the enable FTP over SSL/TLS and this one is now working the next step will be to enable the "Disallow plain unencrypted ftp", but when this flag is checked, my application gets a message of unauthorized access.
here is my code
FtpWebResponse response = null;
try
{
// Get the object used to communicate with the server.
FtpWebRequest request = WebRequest.Create(completePath) as FtpWebRequest;
request.CachePolicy = new System.Net.Cache.RequestCachePolicy(System.Net.Cache.RequestCacheLevel.NoCacheNoStore);
request.Proxy = null;
if (request == null)
{
result.SetError(Translate.InvalidUrl, completePath);
return false;
}
request.Method = WebRequestMethods.Ftp.DownloadFile;
request.Credentials = NetworkCredential;
response = (FtpWebResponse)request.GetResponse();
responseStream = new MemoryStream();
response.GetResponseStream().CopyTo(responseStream);
responseStream.Seek(0, SeekOrigin.Begin);
}
How can I modify my code in order to be able to connected to the FTP server with this configuration?
Thanks Andrea
Upvotes: 0
Views: 35