SFTP

Read and write files or directories to/from SFTP servers

Component key: sftp

Description#

The SFTP component lets you upload, download, move and delete files on an SFTP server. This component supports basic auth (username/password) and private key authentication.

Authorization Methods#

SFTP requires one of the following authorization methods:

Auth TypeKeyDescriptionFields
Basic AuthbasicBasic authorization using a username/password combination

Password |  password

Username |  username

Private Keyprivate_keyPrivate Key authorization based on a username/private key combination

Private Key |  private_key

Username |  username

Actions#

Delete File#

Delete a file from a SFTP server | key: deleteFile

InputKeyDefaultNotesExample

Host

string
/ Required
hostThe address of the SFTP server. This should be either an IP address or hostname.sftp.prismatic.io

Path

string
/ Required
pathPath of file to delete/path/to/file.txt

Port

string
port22The port of the SFTP server.2222

List Directory#

List files in a directory on an SFTP server | key: listDirectory

InputKeyDefaultNotesExample

Host

string
/ Required
hostThe address of the SFTP server. This should be either an IP address or hostname.sftp.prismatic.io

Path

string
/ Required
pathPath of directory on an SFTP server to list files of/path/to/directory/

Pattern

string
pattern*Glob-style string for listing specific files*.txt

Port

string
port22The port of the SFTP server.2222

Output Example Payload#

{
"data": [
"file.txt",
"example.txt"
]
}

Move File#

Move a file on an SFTP server | key: moveFile

InputKeyDefaultNotesExample

Destination Path

string
/ Required
destinationPathPath of file to move/my/destination/path.txt

Host

string
/ Required
hostThe address of the SFTP server. This should be either an IP address or hostname.sftp.prismatic.io

Port

string
port22The port of the SFTP server.2222

Source Path

string
/ Required
sourcePathPath of file to move/my/starting/path.txt

Read File#

Read a file from SFTP | key: readFile

InputKeyDefaultNotesExample

Host

string
/ Required
hostThe address of the SFTP server. This should be either an IP address or hostname.sftp.prismatic.io

Path

string
/ Required
inputPathPath of file on SFTP server to read data from/path/to/file.txt

Port

string
port22The port of the SFTP server.2222

Output Example Payload#

{
"data": {
"data": [
101,
120,
97,
109,
112,
108,
101
],
"type": "Buffer"
},
"contentType": "application/octet"
}

Write File#

Write a file to SFTP | key: writeFile

InputKeyDefaultNotesExample

Data

text
/ Required
dataText to write into the file

Host

string
/ Required
hostThe address of the SFTP server. This should be either an IP address or hostname.sftp.prismatic.io

Path

string
/ Required
outputPathPath on SFTP server to write file/we/love/commas.csv

Port

string
port22The port of the SFTP server.2222