Links

SFTP

Know the component and how to use it.
SFTP conntects to a service that supports the SFTP (Secure File Transfer Protocol or SSH File Transfer) protocol to upload, delete, download, list, or move files.
The parameters of this component are:
  • Operation: the operation to be executed: upload, delete, download, list or move.
  • Account: BASIC or PRIVATE KEY-type account. This field supports Double Braces expressions.
  • Host: host or IP address to be used for the connection. This field supports Double Braces expressions.
  • Username: used only when the account type is PRIVATE KEY. This field supports Double Braces expressions.
  • Port: port number. Generally, assumes value 22. This field supports Double Braces expressions.
  • File Name: name of the file or complete path (full file path) to the file. This field supports Double Braces expressions.
  • Remote File Name: remote file or related path (eg.: tmp/file.txt) to the remote file. This field supports Double Braces expressions.
  • Remote Directory: Base remote directory, which can be related (eg.: pub/tmp) or absolute (eg.: /root/pub). This parameter is mandatory. This field supports Double Braces expressions.
  • Connection Timeout: time limit for the connection with the server to expire (in milliseconds).
  • Overwrite File On Upload: if true, files with conflicting names will be replaced when uploading.
  • Fail On Error: if the option is activated, the execution of the pipeline with error will be interrupted; otherwise, the pipeline execution proceeds, but the result will show a false value for the “success” property.
  • Proxy Enabled: if true, you will be able to set a proxy to establish the connection with the SFTP service.
  • Host: proxy host. Available if Proxy Enabled is activated. This field supports Double Braces expressions.
  • Port: proxy port. Available if Proxy Enabled is activated. This field supports Double Braces expressions.

Message flow

Output

When executing a SFTP component using the operations download, upload or move, the following JSON structure will be generated:
{
"fileName": "picture.png",
"remoteFileName": "imap-console-client.png",
"remoteDirectory": "pub/example",
"success": "true"
}
  • fileName: name of the local file.
  • remoteFileName: path of the remote file or related path of the remote file.
  • remoteDirectory: path of the base remote directory (related or absolute).
  • success: "true" if the operation was successful, "false" if otherwise.
When executing a FTP component using the list operation, the following JSON structure will be generated:
{
"remoteDirectory":"pub/example",
"success":true,
"content":[
{
"file":"file.txt",
"isDirectory":false,
"size":1024,
"permission":"-rwxrwxrwx",
"flag":14,
"accessed":"Sat Jan 14 09:21:05 UTC 2023",
"modified":"Sat Jan 14 09:21:05 UTC 2023"
}
]
}
  • remoteDirectory: path of the base remote directory (related or absolute).
  • success: "true" if the operation was successful, "false" if otherwise.
  • content: list of files in the remoteDirectory.
  • file: name of the file.
  • size: size of the file.
  • isDirectory: if the returned object is a directory, "true" will be shown; if it's a file, "false" will be shown.
  • permissions: a string containing the permission type given to the object.
  • accessed: date of the last access.
  • modified: date of the last change.
  • flag: returns flags, indicating which attributes are present.
IMPORTANT: The manipulation of files inside a pipeline occurs in a protected way. The files becomes available in a temporary directory that only the pipeline under execution has access to.
To understand how message flow works in the Digibee Integration Platform, read this article.
Last modified 2mo ago