FTP Testing Task
The
FTP Testing Task
defines an FTP protocol testing task for FTP functionality, performance, stability, and custom testing.
Main Parameter List
Parameter | Type | Required | Length Limit | Description |
---|---|---|---|---|
target | enum | Yes | - | Task Type Fixed value: FTP |
name | string | Yes | ≤400 chars | Task Name Unique identifier for FTP task |
description | string | No | ≤800 chars | Task Description Detailed explanation of task purpose |
enabled | boolean | Yes | - | Enable Statustrue : Enabled (default)false : Disabled |
beforeName | string | No | ≤400 chars | Predecessor Task Controls task execution order |
server | object | Yes | - | Server Configuration See server configuration details below |
uploadFile | boolean | Yes | - | Transfer Directiontrue : Uploadfalse : Download (default) |
uploadFileSource | enum | No | - | File SourceREMOTE_FILE : Remote fileREMOTE_URL : Remote URLLOCAL_FILE : Local file (default) |
remoteFileName | string | No | ≤4096 chars | Remote Filename Upload: Save filename Download: Download filename |
remoteFileUrl | string | No | ≤4096 chars | Remote File URL Download file from this URL when uploading |
localFileName | string | No | ≤4096 chars | Local Filename Upload: Local file path Download: Local save path |
localFileContent | string | No | ≤2MB | Local File Content Supports Base64/Gzip encoding |
localFileContentEncoding | enum | No | - | Content Encodingnone : Plaintextbase64 : Base64 encodinggzip_base64 : Gzip compressed then Base64 |
binaryMode | boolean | No | - | Transfer Modetrue : Binary modefalse : Text mode |
Note
Supports orchestrating multiple FTP interfaces simultaneously, but only one FTP test can be enabled at a time.
Complete FTP configuration example:
yaml
- target: FTP
name: UploadFromLocalFile
description: Upload file from local file
enabled: true
server:
# FTP server configuration ...
uploadFile: true
uploadFileSource: LOCAL_FILE
remoteFileName: remote.txt
localFileName: local.txt
localFileContent: This is a text file content
localFileContentEncoding: none
binaryMode: false
Server Configuration (server
)
Field Name | Type | Required | Length/Range Limit | Default | Description |
---|---|---|---|---|---|
server | string | Yes | ≤253 chars | - | FTP Server Address Supports IP or full domain Example: ftp.example.com |
port | integer | Yes | 1-65535 | 21 | Service Port Standard port: 21 (command port) Data ports auto-assigned by mode |
username | string | Conditional | ≤400 chars | - | Authentication Account Required when server requires auth Example: ftpuser |
password | string | Conditional | ≤4096 chars | - | Authentication Credential Encrypted storage and transmission Enterprise use SFTP instead |
readTimeout | string | No | 1s-24h | 60s | Data Transfer Timeout Format: number+unit (e.g., 30s) Large files recommend 300s |
connectTimeout | string | No | 1s-24h | 6s | Connection Timeout Format: number+unit (e.g., 10s) Cross-region recommend 15-30s |
FTP server configuration example:
yaml
server:
server: localhost
port: 8084
username: admin
password: 123456
readTimeout: 60s
connectTimeout: 6s
File Transfer Direction (uploadFile
)
- Upload (
true
): Transfer file from local to FTP server - Download (
false
): Get file from FTP server to local
File Source (uploadFileSource
)
Source | Use Case | Related Parameters |
---|---|---|
LOCAL_FILE | Use local file | localFileName localFileContent |
REMOTE_FILE | Use FTP server file | remoteFileName |
REMOTE_URL | Get file from URL | remoteFileUrl |
Transfer Mode (binaryMode
)
Mode | File Types | Characteristics |
---|---|---|
Binary Mode | Images/Videos/Compressed files | Preserves file integrity |
Text Mode | Text files | Auto-converts line endings |
Script Examples (target)
Complete Parameter Configuration Example
yaml
- target: FTP
name: UploadFromLocalFile
description: Upload file from local file
enabled: true
server:
server: localhost
port: 8084
username: admin
password: 123456
readTimeout: 60s
connectTimeout: 6s
uploadFile: true
uploadFileSource: LOCAL_FILE
remoteFileName: remote.txt
localFileName: local.txt
localFileContent: This is a text file content
localFileContentEncoding: none
binaryMode: false
Download File from Server for Upload Example
yaml
- target: FTP
name: UploadFromRemoteFtpFile
description: Download a file from the Ftp server and then upload it
server:
server: localhost
port: 8084
username: admin
password: 123456
uploadFile: true
uploadFileSource: REMOTE_FILE
remoteFileName: remote.txt
Download File from Remote URL for Upload Example
yaml
- target: FTP
name: UploadFromRemoteUrl
description: Download a file from the Ftp server and then upload it
server:
server: localhost
port: 8084
username: admin
password: 123456
uploadFile: true
uploadFileSource: REMOTE_URL
remoteFileUrl: https://pics6.baidu.com/feed/d50735fae6cd7b897fbfd8ad27e746a9d8330e1a.jpeg
Upload Local File Example
yaml
- target: FTP
name: UploadFromLocalFile
description: Upload file from local file
server:
server: localhost
port: 8084
username: admin
password: 123456
uploadFile: true
uploadFileSource: LOCAL_FILE
remoteFileName: remote.txt
localFileName: local.txt
localFileContent: This is a text file content
Upload Local File with Base64 Encoding Example
yaml
- target: FTP
name: UploadAndEncodingFromLocalFile
description: Upload and encode file from local file
server:
server: localhost
port: 8084
username: admin
password: 123456
uploadFile: true
uploadFileSource: LOCAL_FILE
remoteFileName: remote.txt
localFileName: local.txt
localFileContent: VGhpcyBpcyBhIHRleHQgZmlsZSBjb250ZW50
localFileContentEncoding: base64
binaryMode: false
Download File Example
yaml
- target: FTP
name: RetrieveFile
description: Retrieve file from remote Ftp server
server:
server: localhost
port: 8084
username: admin
password: 123456
uploadFile: true
remoteFileName: test.txt
Download and Rename File Example
yaml
- target: FTP
name: RetrieveAndRenameFile
description: "Retrieve file from remote Ftp server and save it. Note: By default,\
\ it is saved in the execution data directory."
server:
server: localhost
port: 8084
username: admin
password: 123456
uploadFile: true
remoteFileName: remote.txt
localFileName: new_file.txt