Skip to content

Files and images

  • File fields: A text column holds an uploaded file, with limits on type and size.
  • File uploads in forms: Forms upload a dropped or chosen file at once with a progress bar, and replace or remove it; tables show its name and a thumbnail.
  • Camera capture: File fields can open the camera directly on phones and tablets with .capture(), so a photo is taken and attached in one step.
  • File storage: Files are kept on disk, or in a bucket of your own.
  • S3-compatible buckets (beta): Files are kept in any bucket that speaks the S3 API, when the app runs on Bun.
  • Files from a seed: A seed or another script writes files into the app’s providers, read from its config and environment as the server reads them.
  • Type detection: An upload’s type is decided from its content, and a disguised file is refused.
  • Your own types: An app names its own media types and their extensions, and files with them are stored and served as those types.
  • File viewers: A plugin registers a viewer for a media type, and a file of that type opens in it in the app instead of downloading.
  • HTML file viewer (beta): Uploaded HTML files open in place in a sandboxed frame, with their images, videos and links resolved to the files stored beside them on the same record.
  • Image and PDF viewers: Two plugins an app can attach open stored images and PDFs in the app, loaded only when such a file opens.
  • Signed downloads: Private files open through short-lived links that stop working once the record no longer holds the file.
  • Type and size fields: Each file’s media type and size are kept in columns of their own, for lists and aggregate queries, and serving reads the type from there.
  • Derived fields: Width, height, size and type of each upload are written to other fields.
  • Image variants and placeholders: Resized copies of uploaded images, and a blurred placeholder while they load.
  • External URLs: A file field can hold a link to a file on another site.
  • Image referrers: Images from other sites load without telling them which page showed them.
  • File cleanup: Replaced and cleared files are deleted later on a schedule, so a database restore still finds its files.