Actions11
- Bucket | 存储桶 Actions
- Folder | 目录 Actions
- File | 文件 Actions
File | 文件 → Upload | 上传
AI-generatedSummary
Upload a file to an Aliyun OSS bucket, optionally within a specified folder, using either binary data from the input or a provided Base64 encoded string.
Inputs
- Bucket Name | 存储桶名称 — Target bucket name; if left empty, uses the default bucket from credentials.
- Use Custom Domain | 使用自定义域名 — Whether to generate the file URL using a custom domain instead of the default OSS endpoint.
- Custom Domain | 自定义域名 — The custom domain to use for generating file URL; must include protocol (e.g., https://assets.example.com). Required if custom domain option is enabled.
- File Name | 文件名 (required) — Name of the file to upload without any folder prefix.
- Folder Key | 文件夹 Key — Optional folder path prefix (e.g., documents/reports) to prepend to the file key.
- Binary Data | 二进制数据 — Choose whether to upload the file from binary data present in the input item.
- Binary Property | 二进制属性名 — If uploading binary data, the name of the binary property containing the file contents; defaults to 'data'.
- File Content (Base64) | 文件内容(Base64) — If not uploading binary data, provide the file content as a Base64 encoded string.
- MIME Type | MIME 类型 — Optional MIME type to override the detected or default content type of the uploaded file.
Output shape
a single record
Returns an object containing the upload success status, bucket name, the full object key of the uploaded file, the ETag identifier, and a URL to access the uploaded file. The URL uses the custom domain if provided and enabled, otherwise the default OSS endpoint.
Examples
Example 1: Upload a binary file to a specified folder and bucket
Set 'Bucket Name' to the target bucket, 'Folder Key' to the desired folder path, enable 'Binary Data', specify the 'Binary Property' holding the file content, and provide the 'File Name'. Optionally, set a MIME type and enable a custom domain for the file URL.
Example 2: Upload a file from a Base64 string to the default bucket without folders
Leave 'Bucket Name' empty to use the default bucket from credentials, disable 'Binary Data' option, supply the Base64 encoded content in 'File Content', and specify the 'File Name'.