Storage
S3 Storage
Configure and use S3-backed file uploads with presigned URLs.
Overview
The app uses direct-to-S3 uploads:
- Client requests a presigned upload URL from oRPC.
- Client uploads file bytes directly to S3 using
PUT. - Client finalizes upload through oRPC, creating a
filerecord in database.
This keeps upload traffic off the app server and stores file metadata for later usage.
Required Environment Variables
S3_REGION=us-east-1
S3_BUCKET=your-bucket
S3_ACCESS_KEY_ID=your-access-key
S3_SECRET_ACCESS_KEY=your-secret-key
S3_ENDPOINT=https://s3.amazonaws.com # optional (for S3-compatible providers)App Configuration
Common storage defaults are defined in src/config/app.ts under APP_CONFIG.files.storage:
keyPrefixpresignedUrlExpiresInSecondsmaxFileSizeBytesmaxFilesCountacceptedTypes
Per-field upload settings from form builder can restrict uploads further, but cannot exceed global max limits.
API Endpoints
Files router exposes two public endpoints:
POST /files/create-presigned-upload-urlPOST /files/finalize-upload
If the request is authenticated, userId is attached to created file metadata.
Form Builder Integration
Form builder supports a file field type with:
acceptedTypesmaxFileSizeBytesmaxFilesCount
The field uploads files immediately via dropzone and stores uploaded file metadata (including direct url) in form state.