tscftpclient ftps delphi example
Posted: Mon 20 Apr 2020 15:56
Is there an example on how to write an FTPS client?
The documentation points to tscftpclient and I have an overview of the methods and properties but the correct call sequence is unclear.
Specifically : What should be called first: Connect or Login?
When I call Connect first it says 'FTP server error occured: not logged in'
When I call Login first an exception is thrown 'FTP client not connected'
FFTPSClient.HostName:=host;
FFTPSClient.port := port;
FFTPSClient.TLSMode:=tmAllowExplicitTLS;
FFTPSClient.Username := user;
FFTPSClient.AuthCommand := acAuto;
FFTPSClient.Password := pwd;
FFTPSClient.UsePassive:=(not (ftpoptNotPassive in ftpoptions));
FFTPSClient.Connect();
FFTPSClient.Login();
The documentation points to tscftpclient and I have an overview of the methods and properties but the correct call sequence is unclear.
Specifically : What should be called first: Connect or Login?
When I call Connect first it says 'FTP server error occured: not logged in'
When I call Login first an exception is thrown 'FTP client not connected'
FFTPSClient.HostName:=host;
FFTPSClient.port := port;
FFTPSClient.TLSMode:=tmAllowExplicitTLS;
FFTPSClient.Username := user;
FFTPSClient.AuthCommand := acAuto;
FFTPSClient.Password := pwd;
FFTPSClient.UsePassive:=(not (ftpoptNotPassive in ftpoptions));
FFTPSClient.Connect();
FFTPSClient.Login();