Upload and Get Presigned URL
AI-generatedOverview
This node uploads a file to an S3/MinIO bucket and immediately generates a presigned URL for the uploaded file. It is useful for scenarios where you want to upload files and provide temporary access URLs for those files, such as sharing files securely or integrating with applications that require temporary file access.
Use Case Examples
- Uploading a user profile image to a MinIO bucket and generating a presigned URL to share the image with other services.
- Uploading a document to an S3 bucket and providing a temporary download link to clients.
Properties
| Name | Meaning |
|---|---|
| Bucket Name | Name of the S3/MinIO bucket where the file will be uploaded. |
| File Name | Name of the file in the bucket to be uploaded. |
| Binary File | Indicates whether the file to upload is binary data. |
| Input Binary Field | Name of the input binary field containing the file to be uploaded (used if the file is binary). |
| File Content | Content of the file as text (used if the file is not binary). |
| Content Type | MIME type of the file being uploaded. |
| Expiration Time (Seconds) | Time in seconds until the generated presigned URL expires. |
Output
JSON
operation- The operation performed, which is 'uploadAndPresign'.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 of the uploaded file.presignedUrl- The generated presigned URL for temporary access to the file.expiresAt- Timestamp when the presigned URL will expire.
Dependencies
- AWS SDK for JavaScript v3 (@aws-sdk/client-s3, @aws-sdk/s3-request-presigner)
Troubleshooting
- Common issues include incorrect bucket names, invalid credentials, or network connectivity problems.
- Errors related to permissions may occur if the provided credentials do not have sufficient rights to upload files or generate presigned URLs.
- Ensure the binary input field name matches the actual binary data field in the input when uploading binary files.
- If the presigned URL expires too soon or too late, adjust the 'Expiration Time (Seconds)' parameter accordingly.
Links
- Amazon S3 Presigned URLs - Official AWS documentation on presigned URLs for S3 objects.
- MinIO Client Quickstart Guide - Guide for using MinIO, which is compatible with S3 APIs.