FTP List
Allows to list files on a FTP or SFTP server.
Json
Example
json
{
"name": "protocol-ftp-list",
"taskReferenceName": "ftp_list",
"description": "The business description of the task",
"type": "SUB_WORKFLOW",
"optional": false,
"inputParameters": {
"connection": "SFTP",
"host": "",
"username": "",
"password": "",
"port": 21,
"remoteFolder": "/",
"depth": 1
}
}
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 |
remoteFolder | The complete path to the folder. If you want to search in the root folder, just set / |
depth | If you need to parse sub folders, you must indicates a depth greater than 1. Maximum depth: 5. |
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
Output
Property | Type | Description |
---|---|---|
listing | An XML file containing the path of available files on the server. | |
noFile | YES | NO . YES : no files have been found. NO : at least one file has been found. |
Listing
Example
xml
<Files>
<File>
<Path>/file-1.jpg</Path>
<Last-Modified>2020-04-10T13:40:23.83Z</Last-Modified>
<Size>1954387</Size>
</File>
<File>
<Path>/sub-folder/file-2.jpg</Path>
<Last-Modified>2020-04-10T13:40:23.83Z</Last-Modified>
<Size>1954387</Size>
</File>
</Files>
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
Definition
XPath | Description | Occurs |
---|---|---|
Files | Root | 1 |
File | For each file listed | 0..* |
Path | The complete path. Subfolders are separated by the / character. Only files are listed, not directories. | 1 |
Last-Modified | The date of update on the FTP in UTC format | 1 |
Last-Modified | The date of the last modification of the file, format is UTC | 1 |
Size | The size of the file in Kb | 1 |
Limits and additional notes
- The limitation of the input file size is 250 Mb.
- 100 files in the same folder (can be less depending on file sizes).
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.