FTPS Example

I noticed that FTPS support has been added (as shown in the API documentation). There doesn’t appear to be an example. Can anyone please point me to a simple example using the Aspose.Network.FTPClient with FTPS?

Hi,


Thanks for your inquiry.

I will get back to you shortly with an example.

Any update on the example you were going to provide?

Hi,


Please use the following sample to connect to FTP using FTPS (SSL).

FtpClient client = new FtpClient(“host”, 21, “user”, “pwd”);
client.SecureConnection = true;
client.DataConnectionMode = DataConnectionMode.Passive;
// ignore invalid/expired security certificates
client.RemoteCertificateValidationCallback =
delegate(object sender, System.Security.Cryptography.X509Certificates.X509Certificate certificate, System.Security.Cryptography.X509Certificates.X509Chain chain, System.Net.Security.SslPolicyErrors sslPolicyErrors)
{
return true;
};

// connect and login
client.Connect(true);
Console.WriteLine(“Connected to FTP Server using FTPS”);
Console.ReadKey();
client.Disconnect();
Console.WriteLine(“Disconnected.”);