AWS S3

Upload, download, and manage files in Amazon S3 buckets from your Spala flows.

AWS S3

The AWS S3 addon provides file storage operations using Amazon Simple Storage Service. Upload files, generate signed URLs for secure downloads, list bucket contents, and delete objects — all from your Spala flows.

Installation

1. Enable the AWS S3 addon from the Addons panel
2. Enter your AWS credentials and bucket configuration

Configuration

Available Steps

Upload File

Uploads a file to S3.

Get Signed URL

Generates a pre-signed URL for temporary secure access to a private file.

Delete File

Deletes an object from S3.

List Files

Lists objects in an S3 bucket with an optional prefix filter.

Example: File Upload Endpoint

// POST /api/files/upload

// Step 1: Set Variable - Generate a unique key
// vars.key = 'uploads/' + vars.auth.userId + '/' + Date.now() + '-' + input.filename
// Step 2: Upload File (S3 addon)
// filePath: input.tempFilePath
// key: vars.key
// contentType: input.contentType
// Step 3: Database Query - Save file record
// INSERT INTO files (user_id, s3_key, filename, content_type, size)
// VALUES (vars.auth.userId, vars.key, input.filename, input.contentType, input.fileSize)
// RETURNING *
// Step 4: Response
// { file: vars.fileRecord }

Example: Secure File Download

// GET /api/files/:fileId/download

// Step 1: Database Query - Get file record and verify ownership
// SELECT * FROM files WHERE id = params.fileId AND user_id = vars.auth.userId
// Step 2: Condition - File not found
// If !vars.file → Respond with 404
// Step 3: Get Signed URL (S3 addon)
// key: vars.file.s3_key
// expiresIn: 300
// Step 4: Response
// { downloadUrl: vars.signedUrl }

Pre-signed URLs provide temporary, secure access to private S3 objects without making the bucket public. Set the expiration time based on your use case — short for downloads (5 minutes), longer for media playback.

Use an IAM user with minimal S3 permissions. Grant access only to the specific bucket(s) your application needs, and avoid using root account credentials.

AWS access key ID with S3 permissions.
AWS secret access key.
Default S3 bucket name.
AWS region (e.g., 'us-east-1').
Local path to the file to upload.
The S3 object key (path within the bucket, e.g., 'uploads/image.png').
MIME type of the file (e.g., 'image/png'). Auto-detected if not provided.
Override the default bucket.
The S3 object key.
URL expiration time in seconds (default: 3600).
Override the default bucket.
The S3 object key to delete.
Override the default bucket.
Filter results to keys starting with this prefix (e.g., 'uploads/user-42/').
Maximum number of results to return (default: 1000).
Override the default bucket.
Addons Overview
/addons
Browse available addons
Installing Addons
/addons/installing
Enable and configure addons in your project