Discuss this help topic in SecureBlackbox Forum

TElSftpClient class

Properties     Methods     Events     Declared in     Licensing     

TElSftpClient provides client-side functionality for SFTP (Secure File Transfer Protocol).


     TElSftpClient is an implementation of SSH File Transfer Protocol client. It works over secure SSH channel (and has nothing common with FTP protocol). SFTP works as a subsystem of SSHv2 protocol, i.e. SFTP negotiation flow is the following:

  • TCP connection is established
  • Secure SSH connection is established
  • SFTP handshake is performed over SSH channel
To add SFTP support to your product you should perform the following sequence of operations:
  • Create the TElSSHClient class instance which would be used as secure transport for SFTP.
  • Create the instance of TElSubsystemSSHTunnel class.
  • Create the TElSSHTunnelList instance. The TElSSHTunnelList is a «bridge» between TElSSHClient and TElSubsystemSSHTunnel class.
  • Assign the just created TElSSHTunnelList instance to TElSSHClient.TunnelList and TElSubsystemSSHTunnel.TunnelList properties. Now TElSSHClient «knows» which tunnels it should request.
  • Create the instance of TElSftpClient class.
  • Assign the created instance of TElSubsystemSSHTunnel to TElSftpClient.Tunnel property.
  • Set up the properties of TElSftpClient instance.
  • Set up the TElSSHClient accordingly to your TCP transport implementation.
  • Call TElSSHClient.Open method. As soon as SSH connection is established, ElSftpClient will automatically perform SFTP handshake and fire the TElSftpClient.OnOpenConnection event.
After SFTP connection is successfully started, you may perform any necessary file operations. The TElSftpClient implementation is asynchronous (event-based). E.g. when you call the RenameFile method it immediately exits without blocking the application. If the file was successfully renamed, the OnSuccess event is fired. Otherwise the OnError event is fired.

Alternatively you can use TElSimpleSFTPClient control which encapsulates all SSH-related components and code.

See Increasing SFTP speed article for details about how to achieve maximum data transfer speed.




Declared in

  • Namespace: SBSftp
  • Assembly: SecureBlackbox.SFTP
  • Unit: SBSftp
  • Package: SecureBlackbox.SFTP.jar
  • sbsftp.h


To use this class in the development and distribution of your software projects, you need to purchase one of the following licenses:

SFTPBlackbox client-only OR SFTPBlackbox client-server OR SecureBlackbox Transports OR SecureBlackbox Standard OR SecureBlackbox Professional

Discuss this help topic in SecureBlackbox Forum