SFTP Component

Read, write, move and delete files on an SFTP server
Component key: sftp#
DescriptionThe SFTP (SSH File Transfer Protocol) component lets you upload, download, move and delete files on an SFTP server.
A common integration pattern involves listing files in a file store, and performing a series of actions on the array of files that are returned. See our looping over files quickstart for information about how to create a loop over an array of files.
#
SFTP Connections#
Basic Username/PasswordThe basic auth connection is used to connect to SFTP servers that support username / password login. Consult your SFTP server administrator to determine which login method the server supports.
Input | Default | Notes | Example |
---|---|---|---|
Input Host string / Required host | Default | Notes The address of the SFTP server. This should be either an IP address or hostname. | Example sftp.prismatic.io |
Input Password password / Required password | Default | Notes | Example p@s$W0Rd |
Input Port string / Required port | Default 22 | Notes The port of the SFTP server. | Example 2222 |
Input Timeout string timeout | Default 3000 | Notes How long the client will await a request. | Example 4000 |
Input Username string / Required username | Default | Notes | Example john.doe |
#
Private KeyThe private key connection allows you to access an SFTP server via SSH public/private key authentication. You will need to generate a public/private key pair, and ensure that your public key is stored on the SFTP server that you are connecting to. Then, you can authenticate with the SFTP server using a username and corresponding private key.
Input | Default | Notes | Example |
---|---|---|---|
Input Host string / Required host | Default | Notes The address of the SFTP server. This should be either an IP address or hostname. | Example sftp.prismatic.io |
Input Port string / Required port | Default 22 | Notes The port of the SFTP server. | Example 2222 |
Input Private Key text / Required privateKey | Default | Notes SSH private key | Example -----BEGIN OPENSSH PRIVATE KEY-----
abc123... |
Input Timeout string timeout | Default 3000 | Notes How long the client will await a request. | Example 4000 |
Input Username string / Required username | Default | Notes | Example john.doe |
#
Actions#
Delete FileDelete a file from a SFTP server | key: deleteFile
Input | Default | Notes | Example |
---|---|---|---|
Input Connection connection / Required connection | Default | Notes | Example |
Input Show Debug Output boolean / Required debug | Default false | Notes Show additional debug output in logs. Note: SFTP is very verbose - expect hundreds of debug lines when this is enabled. | Example |
Input Path string / Required path | Default | Notes Path of file to delete | Example /path/to/file.txt |
#
List DirectoryList files in a directory on an SFTP server | key: listDirectory
Input | Default | Notes | Example |
---|---|---|---|
Input Connection connection / Required connection | Default | Notes | Example |
Input Show Debug Output boolean / Required debug | Default false | Notes Show additional debug output in logs. Note: SFTP is very verbose - expect hundreds of debug lines when this is enabled. | Example |
Input Path string / Required path | Default | Notes Path of directory on an SFTP server to list files of | Example /path/to/directory/ |
Input Pattern string pattern | Default * | Notes Glob-style string for listing specific files | Example *.txt |
#
Output Example Payload{ "data": [ "file.txt", "example.txt" ]}
#
Move FileMove a file on an SFTP server | key: moveFile
Input | Default | Notes | Example |
---|---|---|---|
Input Connection connection / Required connection | Default | Notes | Example |
Input Show Debug Output boolean / Required debug | Default false | Notes Show additional debug output in logs. Note: SFTP is very verbose - expect hundreds of debug lines when this is enabled. | Example |
Input Destination Path string / Required destinationPath | Default | Notes Path of file to move | Example /my/destination/path.txt |
Input Source Path string / Required sourcePath | Default | Notes Path of file to move | Example /my/starting/path.txt |
#
Read FileRead a file from SFTP | key: readFile
Input | Default | Notes | Example |
---|---|---|---|
Input Connection connection / Required connection | Default | Notes | Example |
Input Show Debug Output boolean / Required debug | Default false | Notes Show additional debug output in logs. Note: SFTP is very verbose - expect hundreds of debug lines when this is enabled. | Example |
Input Path string / Required inputPath | Default | Notes Path of file on SFTP server to read data from | Example /path/to/file.txt |
#
Output Example Payload{ "data": "Sample file contents", "contentType": "text/plain"}
#
Stat FilePull statistics about a file | key: statFile
Input | Default | Notes | Example |
---|---|---|---|
Input Connection connection / Required connection | Default | Notes | Example |
Input Show Debug Output boolean / Required debug | Default false | Notes Show additional debug output in logs. Note: SFTP is very verbose - expect hundreds of debug lines when this is enabled. | Example |
Input Path string / Required inputPath | Default | Notes Path of file on SFTP server to read data from | Example /path/to/file.txt |
#
Output Example Payload{ "data": { "mode": 33279, "uid": 1000, "gid": 985, "size": 5, "accessTime": 1566868566000, "modifyTime": 1566868566000, "isDirectory": false, "isFile": true, "isBlockDevice": false, "isCharacterDevice": false, "isSymbolicLink": false, "isFIFO": false, "isSocket": false }}
#
Write FileWrite a file to SFTP | key: writeFile
Input | Default | Notes | Example |
---|---|---|---|
Input Connection connection / Required connection | Default | Notes | Example |
Input Data text / Required data | Default | Notes Text to write into the file | Example |
Input Show Debug Output boolean / Required debug | Default false | Notes Show additional debug output in logs. Note: SFTP is very verbose - expect hundreds of debug lines when this is enabled. | Example |
Input Path string / Required outputPath | Default | Notes Path on SFTP server to write file | Example /we/love/commas.csv |
#
Output Example Payload{ "data": "Uploaded data stream to /upload/path/to/file.txt"}