- Stitch >
- External Services >
- Built-In Services >
- AWS Service
AWS S3 Snippets¶
The code snippets on this page demonstrate how to work with Amazon Simple Storage Service through the AWS Service. All of the snippets require an AWS Service interface with rules that allow the service actions used in the snippet and are intended to be used within a Stitch function.
If your app does not have an AWS Service interface, create one before using these snippets.
AWS Snippets
Upload an Image to S3¶
This Stitch function uploads a Base64 encoded image to AWS S3 using the PutObject action.
Function Parameters¶
Parameter | Type | Description |
---|---|---|
base64EncodedImage |
string | A Base64 encoded image. You can convert an image File to Base64 with the readAsDataURL method from the FileReader Web API. |
bucket |
string | The name of the S3 bucket that will hold the image. |
fileName |
string | The name of the image file, including its file extension. |
fileType |
string | The MIME Type of the image. |
Get an Image From S3¶
This Stitch function retrieves an object from AWS S3 using the GetObject action.
Function Parameters¶
Parameter | Type | Description |
---|---|---|
bucket |
string | The name of the S3 bucket that will hold the image. |
fileName |
string | The name of the image file, including its file extension. |