Skip to main content
The React Native SSH SFTP library provides robust file transfer capabilities with progress tracking and the ability to cancel ongoing transfers.

Downloading Files

Download files from the remote server to your local device:

Basic Download Example

Uploading Files

Upload files from your local device to the remote server:

Basic Upload Example

Progress Tracking

Monitor upload and download progress in real-time using event listeners.

Download Progress

1

Register the progress handler

Set up the DownloadProgress event listener before starting the download:
2

Start the download

Upload Progress

1

Register the progress handler

Set up the UploadProgress event listener before starting the upload:
2

Start the upload

Complete Progress Example

Progress event handlers must be registered before initiating the transfer. The SFTP connection automatically registers progress listeners when established.

Canceling Transfers

You can cancel ongoing uploads and downloads at any time.

Cancel Download

Cancel Upload

Complete Cancellation Example

  • Canceling a transfer will reject the promise with an error
  • Partially transferred files may remain on the filesystem
  • Always handle the cancellation error appropriately in your code

Working with Different File Types

Text Files

Binary Files (Images, Videos, etc.)

Large Files

For large files, always implement:
  • Progress tracking to show transfer status
  • Cancellation capability for user control
  • Error handling for network interruptions
  • Retry logic for failed transfers

Batch Transfers

Transfer multiple files sequentially or in parallel:

Best Practices

1

Always use absolute paths

2

Check available storage space

3

Handle network interruptions

4

Clean up partial transfers

Next Steps

Last modified on March 26, 2026