Skip to main content

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.
Files can be optionally associated with an entity, comment, or space, enabling cascade deletion when the parent object is removed.

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:
ModeDescription
exact-dimensionsEach variant has an explicit { width, height }. Use for fixed-size crops.
aspect-ratio-width-basedAll variants share an aspect ratio; you specify widths. Heights are computed.
aspect-ratio-height-basedAll variants share an aspect ratio; you specify heights. Widths are computed.
original-aspectPreserves the source aspect ratio; you specify the longest-edge size for each variant.
multi-aspect-ratioMultiple aspect ratios combined with explicit sizes.

File Size Limits

Upload typeLimit
Image upload50 MB
Generic file upload50 MB

Hooks

useUploadImage

Upload and process an image with automatic variant generation.

useUploadFile

Upload a generic file and receive a proxy URL.

API Reference