SmartGent MinIO icon

SmartGent MinIO

Upload files and generate presigned URLs for S3/MinIO

Upload File

AI-generated

Overview

This node uploads files to an S3 or MinIO bucket. It supports uploading both binary files and text content as files. Users specify the bucket name, file name, and content type. The node can handle binary data from an input binary field or text content directly. It is useful for scenarios where files need to be programmatically uploaded to cloud storage, such as backing up data, storing user uploads, or integrating file storage into workflows.

Use Case Examples

  1. Uploading a user profile image from binary data to a MinIO bucket.
  2. Uploading a text configuration file as plain text content to an S3 bucket.

Properties

Name Meaning
Bucket Name Name of the S3/MinIO bucket where the file will be uploaded.
File Name Name of the file to be created in the bucket.
Binary File Indicates whether the file content is binary data or text.
Input Binary Field Name of the input binary field containing the file to be uploaded (used if Binary File is true).
File Content Content of the file as text (used if Binary File is false).
Content Type MIME type of the file being uploaded.

Output

JSON

  • operation - The operation performed, here it is 'upload'.
  • bucketName - The name of the bucket where the file was uploaded.
  • fileName - The name of the uploaded file.
  • fileSize - Size of the uploaded file in bytes.
  • contentType - MIME type of the uploaded file.
  • uploadedAt - Timestamp when the file was uploaded.
  • url - URL to access the uploaded file.

Dependencies

  • AWS SDK for JavaScript v3 (@aws-sdk/client-s3 and @aws-sdk/s3-request-presigner)

Troubleshooting

  • Ensure the provided bucket name exists and the credentials have permission to upload files to it.
  • If uploading binary data, verify the input binary field name matches the actual binary data field in the input.
  • Check that the content type is correctly set to match the file content to avoid issues with file handling downstream.
  • Common errors include authentication failures due to incorrect or missing credentials, bucket not found errors, and permission denied errors. Verify credentials and bucket configuration to resolve these.

Links

Discussion