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 signed links: each link works for 24 to 48 hours and comes only with a record the viewer can see, so storage credentials are never exposed and a link can’t be reused for long (File links).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.useCreateEntity).
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 — upload for PDFs and JPEG, PNG or WebP images. No server-side processing — the file is stored as-is, and the returned File carries a signed link to it.
Image Processing Modes
When uploading images, you choose a processing mode that defines how variants are generated:
Every requested size is 1–10000 px, and
dimensions, widths, heights and sizes take at most 30 entries (one variant each). A variant name uses only letters, digits, _, - and ., is at most 64 characters, can’t contain .., and can’t be original. The stored original is shrunk to fit originalMaxSize on its longest side (50–10000, default 3840). The options are one JSON object, the same on Upload Image (file.options) and on a record’s own images (avatarFile.options, images.options, coverFile.options); Upload Image lists every field. Every options object refuses keys it doesn’t take with a 400: a key of another mode, an unknown key inside a nested object, or anything but pathParts in a files.options.
Both uploads, and every file embedded in a record, return the one File shape.
File Size Limits
Hooks
useUploadImage
Upload and process an image with automatic variant generation.
useUploadFile
Upload a generic file and receive its File, with a signed link.
API Reference
- Upload Image —
POST /v8/:projectId/storage/images - Upload File —
POST /v8/:projectId/storage - Fetch File —
GET /v8/:projectId/storage/:fileId - Delete File —
DELETE /v8/:projectId/storage/:fileId

