SFTP
Purpose
Section titled “Purpose”The SFTP Operator enables secure file operations with SFTP (SSH File Transfer Protocol) servers. It provides functionality for listing, downloading, uploading, and deleting files on remote SFTP servers, offering a more secure alternative to standard FTP.
Use Cases
Section titled “Use Cases”- Secure transferring of files between systems
- Backing up data to secure remote servers
- Retrieving data from systems that require encrypted connections
- Automating secure file distribution workflows
- Integrating with systems that expose SFTP interfaces
- Scheduled secure file synchronization
- Compliance with security requirements for file transfers
Supported Operations
Section titled “Supported Operations”list-files
Section titled “list-files”Lists files and directories in the specified SFTP directory.
Input Parameters
Section titled “Input Parameters”host
(string): The SFTP server hostnameport
(integer): The SFTP server portusername
(string): Username for authenticationpassword
(string): Password for authenticationremotePath
(string): The directory path on the SFTP server to list
Output
Section titled “Output”Returns an SFTPListOutput
object containing an array of SFTPFileInfo
objects with the following properties:
directory
(boolean): Whether the item is a directoryname
(string): The file or directory namepath
(string): The full path of the file or directorysize
(long): The file size in bytesmodificationTime
(long): The last modification time as a timestampaccessTime
(long): The last access time as a timestamppermissions
(integer): The file permissions as a numeric maskuid
(integer): The user ID of the file ownergid
(integer): The group ID of the file
delete-file
Section titled “delete-file”Deletes a file from the SFTP server.
Input Parameters
Section titled “Input Parameters”host
(string): The SFTP server hostnameport
(integer): The SFTP server portusername
(string): Username for authenticationpassword
(string): Password for authenticationremotePath
(string): The full path of the file to delete
Output
Section titled “Output”Returns a boolean indicating whether the deletion was successful.
download-file
Section titled “download-file”Downloads a file from the SFTP server.
Input Parameters
Section titled “Input Parameters”host
(string): The SFTP server hostnameport
(integer): The SFTP server portusername
(string): Username for authenticationpassword
(string): Password for authenticationremotePath
(string): The full path of the file to download
Output
Section titled “Output”Returns a FileDto
object containing information about the downloaded file, including:
id
(string): The unique identifier of the filename
(string): The file namecontentType
(string): The content type of the filesize
(long): The file size in bytesorganizationId
(string): The organization ID associated with the file
upload-file
Section titled “upload-file”Uploads a file to the SFTP server.
Input Parameters
Section titled “Input Parameters”host
(string): The SFTP server hostnameport
(integer): The SFTP server portusername
(string): Username for authenticationpassword
(string): Password for authenticationremotePath
(string): The destination path on the SFTP serverfile
(FileDto): The file to upload, containing:id
(string): The unique identifier of the fileorganizationId
(string): The organization ID associated with the file
Output
Section titled “Output”Returns a boolean indicating whether the upload was successful.
Example
Section titled “Example”{ "host": "sftp.example.com", "port": 22, "username": "sftpuser", "password": "password123", "remotePath": "/uploads/data.csv", "file": { "id": "file-123", "organizationId": "org-456" }}
- The SFTP operator uses the SSH protocol for secure file transfers
- All connections use a promiscuous host key verifier, which accepts any host key (suitable for testing but may need to be enhanced for production use)
- Only password authentication is currently supported