Getting started
File storage
Upload files with records, serve them from your Project address, create thumbnails, and protect private files with short-lived tokens.
Add a file field
- Open a table in Database.
- Add a file field.
- Set the allowed file types, maximum size, and how many files it can hold.
- Mark it protected if only signed-in users should download it.
Upload with JavaScript
const post = await rb.from("posts").create({
title: "Hello",
cover: fileInput.files[0],
});Upload with Dart
import "package:http/http.dart" as http;
await rb.from("posts").create(
{"title": "Hello"},
files: [http.MultipartFile.fromString("attachment", "content", filename: "note.txt")],
);Show and protect files
rb.files.url(record, record.avatar, { thumb: "100x100" });
// protected files need a short-lived token
const token = await rb.files.token();
rb.files.url(record, record.contract, { token });Your own object storage
Plans that include it can store files in your own S3-compatible bucket instead of Project storage. Set it up in Project settings.
Production guidance
- Limit file types and sizes.
- Keep private files protected.
- Delete files you no longer need and watch storage usage.
- Include files in your backup plan.
Found something wrong on this page?
Fix it yourself. The link below opens this file in GitHub's editor and forks the repository for you if you need one, and your change becomes a pull request without leaving the browser.