Actions20
Overview
This node enables downloading files from Dropbox using the Dropbox API. It supports specifying the file path to download and allows returning the file content either as a base64 encoded string or as a raw buffer. This functionality is useful in workflows where you need to retrieve files stored in Dropbox for further processing, such as reading document contents, image manipulation, or transferring files to other services.
Practical examples:
- Downloading an image file from Dropbox and passing it to an image recognition service.
- Retrieving a PDF report from Dropbox and sending it via email.
- Fetching a CSV file from Dropbox to import data into a database.
Properties
| Name | Meaning |
|---|---|
| File Path | The full path of the file in Dropbox to download (e.g., /path/to/file.jpg). |
| Return Format | Format to return the downloaded file content: Base64 (base64 encoded string) or Buffer (raw binary buffer). |
| Output Field | The name of the field in the output JSON where the downloaded file content will be stored. |
Output
The node outputs a JSON object with the following structure:
resource: Always"file".operation: Always"download".path: The file path that was downloaded.metadata: Metadata about the file returned by Dropbox (parsed from response headers).size: Size of the downloaded file in bytes.content_type: Content type inferred from metadata (usually"application/octet-stream").<outputField>: The actual file content, either as a base64 encoded string or a buffer, depending on the selected return format.
If the return format is set to "Base64", the file content is a base64 string; if set to "Buffer", it is a raw binary buffer.
Dependencies
- Requires a valid OAuth 2.0 access token for Dropbox API authentication.
- Uses the Dropbox API endpoints for file download (
https://content.dropboxapi.com/2/files/download). - Requires the node to be configured with an API key credential that supports OAuth 2.0 with automatic token refresh.
Troubleshooting
Common issues:
- Invalid or expired OAuth token: The node attempts to refresh the token automatically but may fail if refresh credentials are invalid or missing.
- Incorrect file path: If the specified file path does not exist or is incorrect, the Dropbox API will return an error.
- Permission errors: The OAuth token must have sufficient permissions to access the requested file.
Error messages:
"OAuth token refresh failed: ..."indicates problems refreshing the access token. Check OAuth credentials and refresh token validity."Dropbox operation failed: ..."indicates a failure in the Dropbox API call, often due to invalid parameters or insufficient permissions.
To resolve these errors, verify the OAuth credentials, ensure the file path is correct, and confirm the app has necessary Dropbox scopes.