Zalo Upload Attachment
AI-generatedOverview
This node is designed to upload files to a specified thread, which can be either a user or a group. It supports multiple file sources for uploading, including local file paths, remote file URLs, and binary data from previous nodes. This flexibility makes it useful in scenarios where you want to automate sending files to chat threads or groups, such as sharing reports, images, or documents automatically.
Practical examples:
- Uploading a report PDF stored locally to a specific user chat.
- Sending an image fetched from a URL to a group conversation.
- Forwarding binary data (e.g., a file generated by a previous node) to a user thread.
Properties
| Name | Meaning |
|---|---|
| Thread ID | The identifier of the thread (user ID or group ID) where the file(s) will be uploaded. |
| Thread Type | The type of thread: "User" or "Group". |
| Upload Sources | A list of one or more file sources to upload. Each source can be one of: |
| - File Path: Local path to the file to upload. | |
| - File URL: URL of the file to download and upload. | |
| - Binary Data: Binary property name containing file data from previous nodes; requires specifying the file name. |
Output
The node outputs an array of JSON objects, each corresponding to an input item processed. Each output object contains:
success: Boolean indicating if the upload succeeded.threadId: The thread ID where files were uploaded.threadType: The type of thread ("user" or "group").uploadResults: An array or object detailing the results of the upload operation.totalFiles: Number of files successfully uploaded.error(optional): If the upload failed, this field contains error details.
The node does not output binary data itself but processes binary inputs if provided.
Dependencies
- Requires an API authentication token or cookie credential to authenticate with the target service.
- Uses filesystem access to read local files.
- Supports downloading files from URLs.
- Requires proper configuration of credentials within n8n to authorize uploads.
Troubleshooting
- Missing or invalid thread ID: The node requires a valid thread ID; ensure it is correctly set.
- File not found: For file path sources, verify that the file exists at the specified path.
- Invalid file URL: For URL sources, ensure the URL is accessible and points to a valid file.
- Missing binary data or filename: When using binary data, the binary property must exist and a filename must be provided.
- Authentication errors: Ensure the API key or cookie credential is valid and has necessary permissions.
- Upload failures: Check error messages returned in the output's
errorfield for details.
Common error messages include:
- "File does not exist": Indicates the local file path is incorrect.
- "Failed to download file": The URL is unreachable or invalid.
- "Binary data missing": The specified binary property was not found.
- Authentication-related errors: Invalid or expired credentials.
Resolving these typically involves verifying input parameters, credentials, and network accessibility.
Links and References
- No external links are provided in the source code. For further information, consult the documentation of the service/API used for uploading files or n8n community forums for similar use cases.