Skip to content

Files Storage (Local & S3)

Microbase stores uploaded files on local disk (DATA_DIR=./storage) by default and supports hot-swapping to any S3-compatible storage (AWS S3, Cloudflare R2, MinIO).

S3_ENABLED=true
S3_ENDPOINT=https://<account>.r2.cloudflarestorage.com
S3_BUCKET=microbase-files
S3_REGION=auto
S3_ACCESS_KEY=your-access-key
S3_SECRET_KEY=your-secret-key
S3_FORCE_PATH_STYLE=true
  • Request resized thumbnails on the fly: GET /api/files/:collection/:recordId/:filename?thumb=300x300 (enforces pixel & dimension limits to prevent image-bomb DoS).
  • For protected collections, request a short-lived token via POST /api/files/token and pass ?token=<FILE_TOKEN>.