FILES · BETA
Files next to the data, in the owner's storage.
Photos and documents live in the same account as the data, in folders, counted in the owner's quota. Share them with the same grants as collections.
Ana's storage photos/ · docs/
Sam photos/shared/: read
Buyers files of their tier: read
An <img> URL, expires in 1 hour
UPLOAD Up to 10 MB a file Upload into a folder with progress events. Attach up to 4 KB of your own metadata.
SHOW URLs for images and video Get a short-lived URL for image tags, video and links. It stops working when the user loses access.
SHARE Grants, like collections Share a folder by its path, or unlock files for buyers by their metadata.
Upload, show, share.
One call each. File grants use the reserved collection name _files, with the same filters as everywhere else.
const file = await bzr.files.upload(input.files[0], { path: "photos/" }) img.src = await bzr.files.getUrl(file.id)
// Sam can read everything in photos/shared/ await bzr.permissions.create({ collectionName: "_files", granteeType: GranteeType.USER, granteeId: samId, types: [PermissionType.READ], filter: { path: { $startsWith: "photos/shared/" } }, })
Counted in the owner's quota Files use the owner's storage, not yours. The free plan includes 100 MB of files.
Live folders Subscribe to a path and see uploads, replacements and deletes as they happen.
Uploaded pages can't run Opening a file URL downloads the file, whatever its type, so uploaded HTML never runs on Bazaar's domain.
What files can't do yet.
Large files 10 MB per file. Uploads and downloads have hourly limits per user and app.
Permanent public links File URLs expire within 24 hours and stop working when the user loses access.
A settled API Files are in beta. The API may still change.