Overview
This node uploads files to Qiniu Cloud Object Storage. It supports uploading either from binary data directly available in the workflow or by downloading a file from a given URL and then uploading it. This is useful for automating file storage workflows, such as backing up files, processing images or documents, or integrating with other services that generate files.
Typical use cases include:
- Uploading user-generated content or processed files from previous nodes.
- Downloading remote files (e.g., images, documents) and storing them in Qiniu Cloud for further use or sharing.
- Automating backups of files to cloud storage.
Properties
| Name | Meaning |
|---|---|
| Bucket Name | The name of the Qiniu Cloud bucket where the file will be uploaded. |
| Domain | The domain URL used to access the uploaded files (e.g., https://your-domain.com). |
| File Key | The key (filename) under which the file will be stored in the bucket. |
| Input Type | Source of the file to upload: - Binary Data: Upload from binary data field in the input item. - URL: Download the file from a URL and upload it. |
| Input Data Field Name | (When Input Type is Binary) The name of the binary property containing the file data to upload. |
| File URL | (When Input Type is URL) The URL of the file to download and upload. |
| Additional Options | Collection of optional settings: - Content Type: Specify the MIME type of the file. - Overwrite: Whether to overwrite an existing file with the same key. - Download Timeout (seconds): Timeout for downloading the file when using URL input. - Auto Extract Filename: Automatically extract filename from URL if File Key is empty (only applies to URL input). |
Output
The node outputs an array of items corresponding to each input item processed. Each output item contains:
jsonobject with:bucket: The bucket name where the file was uploaded.key: The key (filename) used for the uploaded file.hash: The hash returned by Qiniu Cloud for the uploaded file.success: Boolean indicating whether the upload succeeded.fileUrl: The full URL to access the uploaded file, constructed from the provided domain and file key.- Any additional response fields returned by Qiniu Cloud's upload API.
binarydata: The original binary data from the input item is preserved in the output.
If an error occurs during upload and "Continue On Fail" is enabled, the output item will contain:
json.error: Error message describing the failure.json.success:false
Dependencies
- Requires an API key credential for Qiniu Cloud with access key, secret key, and region configuration.
- Uses the official Qiniu SDK for Node.js (
qiniupackage). - Uses
axiosfor HTTP requests when downloading files from URLs. - Requires proper network access to Qiniu Cloud endpoints and any URLs specified for download.
- The node expects the user to configure credentials securely within n8n.
Troubleshooting
Failed to download file from URL:
This error occurs if the node cannot fetch the file from the provided URL. Possible causes include invalid URL, network issues, or timeout.
Resolution: Verify the URL is correct and accessible. Increase the download timeout option if needed.Upload failed with status code:
Indicates the upload request to Qiniu Cloud failed. Could be due to invalid credentials, insufficient permissions, or incorrect bucket/key names.
Resolution: Check your Qiniu Cloud credentials and bucket permissions. Ensure the bucket exists and the key is valid.Invalid input type:
Happens if the input type parameter is set to a value other than "binary" or "url".
Resolution: Use only supported input types.Missing binary data:
When using binary input type, if the specified binary property does not exist or is empty, the node will throw an error.
Resolution: Confirm the binary property name matches the actual binary data field in the input.Filename extension issues:
If the file key does not have a proper extension, the node attempts to append one based on the MIME type. If this fails, the file may be uploaded without an extension, potentially causing access issues.
Resolution: Provide a valid file key or enable auto-extract filename option when using URL input.