Skip to content

Download File

Download a single file from the DTN FTP server and return it as binary data.

downloadFile

file

ParameterTypeRequiredDefaultDescription
File PathstringYes-The path to the file to download
OptionTypeDefaultDescription
Binary PropertystringdataName of the binary property to store the file in

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"
}
FieldTypeDescription
fileNamestringName of the downloaded file
filePathstringFull path to the file
sizenumberFile size in bytes

The downloaded file is stored as binary data with automatic MIME type detection:

  • .csv files: text/csv
  • .txt files: text/plain
  • Other files: application/octet-stream
  • 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