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 β
- Sending products on an FTP
1. Export Items Export products
2. FTP Post Send products to FTP2
- 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 FTP2
3
4
- 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 FTP2
3
4
5
Inputs and Outputs β
{
"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}"
}
}2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{
"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}"
}
}2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{
"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}"
}
}2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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
connectionproperty is invalid.
| Property | Description |
|---|---|
connection | Mandatory β Enum - FTP, SFTP, FTPS |
authenticationMethod | Enum - PASSWORD, PUBLIC_KEY (only available if connection = SFTP), Default: PASSWORDIf mode != SFTP and authenticationMethod = PUBLIC_KEY, the task fails. |
host | Mandatory - String |
privateKey | Mandatory if authenticationMethod=PUBLIC_KEY - StringIt is strongly recommended to use a secret variable to store the private key. |
passphrase | String Only taken into account if authenticationMethod= PUBLIC_KEY. |
username | Mandatory - String |
password | Mandatory if connection != SFTP, if connection == SFTP and passord is set then an invalid input error is added - String |
port | Mandatory - Number |
mode | Mandatory, Enum - FILES, FILE, REQUESTFILES: 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 |
remoteFolder | Mandatory if mode = PARAMETERS - String - Default value: / The folder in which the file(s) should be placed |
files | Mandatory if mode = FILES Array of FileList of files to upload |
file | Mandatory if mode = FILE β FileThe file to be uploaded |
request | Mandatory 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.
| Property | Description |
|---|---|
allFilesSent | Enum - YES, NOIf all files could be uploaded: YES otherwise NO. |
Details regarding the request document β
<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>2
3
4
5
6
7
8
9
10
| XPath | Description | Occurrence |
|---|---|---|
Ftp-Post | Root | 1 |
File | For each file to be recovered | 0..* |
Url | The URL of the file to put on the FTP. It can be a Product-Live URL or a public URL. | 1 |
Path | The 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.