Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
518 views
in .NET FTP by (120 points)
We've been told at work that we need to start sending files over using TLS, but I haven't been able to find how to switch to that using SecureFTPConnection.  I've seen some examples using the Client, but not with the other class.  Are there code examples on how to accomplish this?

1 Answer

0 votes
by (161k points)

The User Guide provides comprehensive examples and documentation, but it's primarily a matter of setting the protocol:


?// Create SecureFTPConnection object
SecureFTPConnection ftpConnection = new SecureFTPConnection();

// setting server address and credentials
ftpConnection.ServerAddress = serverAddress;
ftpConnection.UserName = userName;
ftpConnection.Password = password;

// select explicit FTPS
ftpConnection.Protocol = FileTransferProtocol.FTPSExplicit;

// switch off server validation (unsafe - only do this when testing) ftpConnection.ServerValidation = SecureFTPServerValidationType.None;

// connect to server
ftpConnection.Connect();

Categories

...