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 Notes#

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

Authorization#

Authorization is required for this action.
Auth TypeKeyDescriptionFields
Basic AuthbasicBasic authorization using a username/password combination

Username |  username

Password |  password

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

Username |  username

Private Key |  private_key


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

Authorization#

Authorization is required for this action.
Auth TypeKeyDescriptionFields
Basic AuthbasicBasic authorization using a username/password combination

Username |  username

Password |  password

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

Username |  username

Private Key |  private_key

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

Authorization#

Authorization is required for this action.
Auth TypeKeyDescriptionFields
Basic AuthbasicBasic authorization using a username/password combination

Username |  username

Password |  password

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

Username |  username

Private Key |  private_key


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

Authorization#

Authorization is required for this action.
Auth TypeKeyDescriptionFields
Basic AuthbasicBasic authorization using a username/password combination

Username |  username

Password |  password

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

Username |  username

Private Key |  private_key

Output Example Payload#

{  "data": {    "type": "Buffer",    "data": [      101,      120,      97,      109,      112,      108,      101    ]  },  "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

Authorization#

Authorization is required for this action.
Auth TypeKeyDescriptionFields
Basic AuthbasicBasic authorization using a username/password combination

Username |  username

Password |  password

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

Username |  username

Private Key |  private_key

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

Authorization#

Authorization is required for this action.
Auth TypeKeyDescriptionFields
Basic AuthbasicBasic authorization using a username/password combination

Username |  username

Password |  password

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

Username |  username

Private Key |  private_key