Skip to main content

connectSFTP()

Connects to the SFTP server.
It is not mandatory to call this method before calling any SFTP method. The library will automatically establish an SFTP connection when needed.

Signature

Parameters

CallbackFunction<void>
Optional callback function to be called after the connection is established.

Returns

Promise<void>
A promise that resolves when the connection is established successfully, or rejects with an error if the connection fails.

Example


disconnectSFTP()

Disconnects the SFTP connection.
On iOS, this method has limited functionality. The SFTP stream will be closed when the SSH connection is disconnected using disconnect().

Signature

Parameters

None

Returns

void
This method does not return a value.

Example

Platform Notes

  • Android: Fully supported. Explicitly closes the SFTP channel.
  • iOS: The SFTP stream will be closed when disconnect() is called on the SSH client.
Last modified on March 26, 2026