S3 Query
The S3 Query step allows you to execute multiple operations on S3-compatible data sources.
Action configuration
To configure the action, you need to select your S3 data source and specify the required settings depending on the S3 action type selected.
The following action types are available:
List all files in a bucket
Read a file from S3
Download a file from S3
Generate presigned url for GET/PUT
Upload data
Copy file to a new location
Delete a file from S3
Move file to a new location
Get tags from a file in S3
Delete tags from a file in S3
Update tags for a file in S3
If you do not specify the bucket name in the action step, then the one defined in the data source settings will be used.
You can use interpolation to compose bucket names, file names, and other step settings. For example, a file name could be like this:
When reading a file from an S3 bucket, its body will be provided as a Base64-encoded string. You can use the following code in the result mapper to convert it to raw mode:
Use case: Uploading an image using the Upload Data action type
Let's say you want to upload an image from file input to your S3 data source. Here's how you can do that:
Create a new action of the JavaScript Code type and specify the following code:
This step will read the file from the file input as a binary string.
Now, add the second step to this action and select your S3 data source.
Select Upload data from the S3 action type dropdown and specify all the required fields. Add the
{{data}}
variable to the Upload data field - it will use the result of the first step.
Finally, run the action.
Last updated
Was this helpful?