Download File
Download a single file from the DTN FTP server and return it as binary data.
Operation
Section titled “Operation”downloadFile
Resource
Section titled “Resource”file
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| File Path | string | Yes | - | The path to the file to download |
Options
Section titled “Options”| Option | Type | Default | Description |
|---|---|---|---|
| Binary Property | string | data | Name of the binary property to store the file in |
Response
Section titled “Response”Success
Section titled “Success”Returns file metadata in JSON and the file content as binary data:
{ "fileName": "pricing_2024-01-15.csv", "filePath": "/data/pricing_2024-01-15.csv", "size": 15420}The binary data is available in the specified binary property (default: data).
{ "success": false, "error": "File not found", "filePath": "/data/missing.csv"}Response Fields
Section titled “Response Fields”| Field | Type | Description |
|---|---|---|
| fileName | string | Name of the downloaded file |
| filePath | string | Full path to the file |
| size | number | File size in bytes |
Binary Data
Section titled “Binary Data”The downloaded file is stored as binary data with automatic MIME type detection:
.csvfiles:text/csv.txtfiles:text/plain- Other files:
application/octet-stream
Error Handling
Section titled “Error Handling”- Missing Host: DTN credential is missing host
- File Not Found: Specified file path does not exist
- Permission Denied: Insufficient permissions to read file
- Connection Failure: Unable to connect to FTP server