FTP Post
Allows to send one ore more files via the FTP or SFTP protocol. For example you want to daily export products to a sFTP server.
Json
Example
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": "${previous_taskReferenceName.output.file}"
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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": "/",
"files": "${previous_taskReferenceName.output.files}"
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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": "${previous_taskReferenceName.output.file}"
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Definition
Property | Type | Required | Description |
---|---|---|---|
The name (or type) of the task | |||
The unique name of the task in your job. It is used to reference this task in the workflow. | |||
The functional description of this task in your job. | |||
The type of the task. It must be SUB_WORKFLOW . | |||
true : the job continues if there is an error on this task. false : the job fails. | |||
Input parameters of the task. See below |
Inputs
Property | Description |
---|---|
connection | The protocol. Must be FTP or SFTP or FTPS . |
authenticationMethod | PASSWORD , PUBLIC_KEY Default: PASSWORD If connection is not SFTP and authenticationMethod is PUBLIC_KEY , the task fails. |
host | You can use a dns or an IP address. |
privateKey | The private key It is required to use a secret variable to store the private key. |
passphrase | The private key passphrase Only taken into account if authenticationMethod= PUBLIC_KEY . |
username | Username |
password | Password If connection is no SFTP , if connection is SFTP and password is set then an invalid input error is added |
port | Port |
mode | FILE | FILES | REQUEST . FILE : the input file will be sent. FILES : all the files in the input files will be sent. REQUEST : the files will be sent as defined in the request input. |
remoteFolder | <Tag text="required if mode = FILE |
file | A valid input. The file that must be sent. |
files | A valid input. The array of files that must be sent. |
request | A valid input. A file that defines which files must be sent and where. See the definition 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-----
Input request
Example
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>
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
Definition
XPath | Description | Occurs |
---|---|---|
Ftp-Post | Root of the document | 1 |
./File | For each file. | 1 |
./File/Url | The url of the file that must be sent. Usually the url generated in the listing file of a previous task. It can also be an external url. | 1 |
./File/Path | The exact file path that must be retrieved. Must starts with / | 1 |
Outputs
This task does not have outputs.
Limits and additional notes
The limitation of files that can be sent is 100 (it can depends on file size).
In addition to these limitations, the following practices are recommended:
Always limit the number of files on a FTP folder
Always create one folder for one type of file eg. never have a folder and a file at the same level of path.This way you can always use the Last file method to retrieve your file on the server.