Overview
Sublay’s storage system lets you upload files and images on behalf of authenticated users. Uploaded assets are stored in managed cloud storage and served through a proxy URL so direct storage credentials are never exposed to the client.Requires the
files-images bundle. File and image uploads are only available when the files-images bundle is installed on your project. See Bundles to add it.Upload Modes
Sublay provides two hooks for uploading assets:- Image upload — server-side processing with automatic variant generation (resizing, format conversion, EXIF stripping). Returns named variants for responsive display.
- File upload — generic upload for documents, videos, and other files. No server-side processing — the file is stored as-is and a proxy URL is returned.
Image Processing Modes
When uploading images, you choose a processing mode that defines how variants are generated:| Mode | Description |
|---|---|
exact-dimensions | Each variant has an explicit { width, height }. Use for fixed-size crops. |
aspect-ratio-width-based | All variants share an aspect ratio; you specify widths. Heights are computed. |
aspect-ratio-height-based | All variants share an aspect ratio; you specify heights. Widths are computed. |
original-aspect | Preserves the source aspect ratio; you specify the longest-edge size for each variant. |
multi-aspect-ratio | Multiple aspect ratios combined with explicit sizes. |
File Size Limits
| Upload type | Limit |
|---|---|
| Image upload | 50 MB |
| Generic file upload | 50 MB |
Hooks
useUploadImage
Upload and process an image with automatic variant generation.
useUploadFile
Upload a generic file and receive a proxy URL.
API Reference
- Upload Image —
POST /:projectId/api/v7/storage/images - Upload File —
POST /:projectId/api/v7/storage - Fetch File —
GET /:projectId/api/v7/storage/:fileId - Delete File —
DELETE /:projectId/api/v7/storage/:fileId

