Skip to main content

SFTP Component

Read, write, move and delete files on an SFTP server

Component key: sftp

Description#

The SFTP 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.

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

This component supports basic auth (username/password) and private key authentication.

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"}

Stat File#

Pull statistics about a file | key: statFile

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": {    "gid": 985,    "uid": 1000,    "mode": 33279,    "size": 5,    "isFIFO": false,    "isFile": true,    "isSocket": false,    "accessTime": 1566868566000,    "modifyTime": 1566868566000,    "isDirectory": false,    "isBlockDevice": false,    "isSymbolicLink": false,    "isCharacterDevice": false  }}

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