Skip to content

Data Factory > protocol-ftp-post ​

TL;DR;

This task allows sending one or more files to a FTP/SFTP server.

Name:

Max execution time: 120 mins

Target ​

Upload one or more files to an FTP/SFTP server

Example of use in a job ​

  1. Sending products on an FTP
1. Export Items Export products
2. FTP Post Send products to FTP
  1. Generate several Zip files containing images and send them to an FTP

In this case we want all the output files from the Zip job to go to a known folder on an FTP

1. Export Items Export selected products
2. XSLT Prepare the file for the Zip job
3. Zip Generate as many Zip files as needed
4. FTP Post Send the Zip to an FTP
  1. Generate several Zip files containing images and create one folder per Zip on the FTP

In this case define the destination folders programmatically, i.e. pass an XML as input to the FTP Post task that will define which file should go where.

1. Export Items Export the selected products
2. XSLT Prepare the file for the Zip task
3. Zip Generate as many Zip files as needed
4. XSLT Prepare the file for the FTP Post task
5. FTP Post Send the Zip to an FTP

Inputs and Outputs ​

json
{
  "name": "protocol-ftp-post",
  "taskReferenceName": "ftp_post",
  "description": "The business description of the task",
  "type": "SUB_WORKFLOW",
  "optional": false,
  "inputParameters": {
    "connection": "SFTP",
    "host": "",
    "username": "",
    "password": "",
    "port": 21,
    "mode": "FILES",
    "remoteFolder": "/images/",
    "files": "${b.output.files}"
  }
}
json
{
  "name": "protocol-ftp-post",
  "taskReferenceName": "ftp_post",
  "description": "The business description of the task",
  "type": "SUB_WORKFLOW",
  "optional": false,
  "inputParameters": {
    "connection": "SFTP",
    "host": "",
    "username": "",
    "password": "",
    "port": 21,
    "mode": "FILE",
    "remoteFolder": "/products/",
    "file": "${b.output.file}"
  }
}
json
{
  "name": "protocol-ftp-post",
  "taskReferenceName": "ftp_post",
  "description": "The business description of the task",
  "type": "SUB_WORKFLOW",
  "optional": false,
  "inputParameters": {
    "connection": "SFTP",
    "host": "",
    "username": "",
    "password": "",
    "port": 21,
    "mode": "REQUEST",
    "request": "${a.output.file}"
  }
}

Inputs ​

TIP

If at least one task parameters (whether mandatory or not) is invalid, task execution is stopped and the returned status is FAILED. For example:

  • The proposed value for the connection property is invalid.
PropertyDescription
connectionMandatory – Enum - FTP, SFTP, FTPS
authenticationMethodEnum - PASSWORD, PUBLIC_KEY (only available if connection = SFTP), Default: PASSWORD
If mode != SFTP and authenticationMethod = PUBLIC_KEY, the task fails.
hostMandatory - String
privateKeyMandatory if authenticationMethod=PUBLIC_KEY - String
It is strongly recommended to use a secret variable to store the private key.
passphraseString
Only taken into account if authenticationMethod=PUBLIC_KEY.
usernameMandatory - String
passwordMandatory if connection != SFTP, if connection == SFTP and passord is set then an invalid input error is added - String
portMandatory - Number
modeMandatory, Enum - FILES, FILE, REQUEST
FILES: Places all the files in files in the remoteFolder.
FILE: Places the file in file in the remoteFolder.
REQUEST: Allows you to dynamically define a list of files to drop
remoteFolderMandatory if mode = PARAMETERS - String - Default value: /
The folder in which the file(s) should be placed
filesMandatory if mode = FILES Array of File
List of files to upload
fileMandatory if mode = FILE – File
The file to be uploaded
requestMandatory if mode = REQUEST - File
See below

TIP

The supported private keys are the following :

  • ---- BEGIN SSH2 PUBLIC KEY ----
  • -----BEGIN RSA PRIVATE KEY-----
  • -----BEGIN DSA PRIVATE KEY-----
  • -----BEGIN EC PRIVATE KEY-----
  • PuTTY-User-Key-File-2: (ssh-rsa)
  • PuTTY-User-Key-File-2: (ssh-dss)
  • -----BEGIN OPENSSH PRIVATE KEY-----

Outputs ​

TIP

The outputs of the task defined below are always available if the task completes its execution (status COMPLETED and FAILED). If the task is stopped before the end of its execution (if the task is canceled by the user for example - CANCELED status, or if it exceeds the authorized execution time - TIMED_OUT), the outputs are not available.

PropertyDescription
allFilesSentEnum - YES, NO
If all files could be uploaded: YES otherwise NO.

Details regarding the request document ​

xml
<Ftp-Post>
    <File>
        <Url>https://app.product-live.com/files-data-factory/d05a74cf11788d8f3ae9bfee0e028dde66f0c83005c5e0d1211b0069945c0c11</Url>
        <Path>/products-1.csv</Path>
    </File>
    <File>
        <Url>https://app.product-live.com/files-data-factory/d05a94cf11788d8f3ae9bf0e0e028dde66f0c83005c5e0d1211b0069945c0c12</Url>
        <Path>/sub-folder/products-2.csv</Path>
    </File>
</Ftp-Post>
XPathDescriptionOccurrence
Ftp-PostRoot1
FileFor each file to be recovered0..*
UrlThe URL of the file to put on the FTP. It can be a Product-Live URL or a public URL.1
PathThe complete path with the extension. Subfolders are separated by the / character. Starts with /.1

Known limitations ​

  • For SFTP connections, only the following ciphers are allowed: aes256-cbc, aes192-cbc, aes128-cbc, blowfish-cbc, 3des-cbc, aes128-gcm, aes256-gcm, arcfour256, arcfour128, cast128-cbc, arcfour.