Overview
What the Upload fragment provides out of the box.
What you get
- File + upload data model: Separate file and upload records with statuses, metadata, and lifecycle timestamps. Uploads are sessions; a file exists once its content is published.
- Content in your database: File content lives in the fragment's own table. A write stores the content and publishes the file in one transaction. See Storage.
- Batch publication: Prepare several uploads, then publish, delete, and check files together in one atomic commit with revision preconditions.
- Search and edits: An optional text index, server-side text edits, and signed file links.
- Hooks for lifecycle events:
onFileReady,onUploadFailed, andonFileDeleted. - Client helpers: Upload with progress reporting, download, edit, and search.
Typical flow
- Create an upload with
POST /uploads. - Send its content with
PUT /uploads/:uploadId/content, which publishes the file, or prepares it when the upload belongs to a batch. - Fetch metadata or download the file when needed.
POST /files does both steps in one multipart request.
Retry + idempotency
POST /uploadsis idempotent only when a checksum is provided. If a matching, unfinished upload already exists, the server returns it so clients can resume.- Without a checksum, a second upload of the same
fileKeyis rejected withUPLOAD_ALREADY_ACTIVE, unless it setsreplaceActiveUpload. - Sending content to a prepared batch upload again returns the same prepared write.
Retention
- Completed uploads are retained for auditing and retries.
- Uploads that expire before their content arrives, or prepared uploads whose batch never commits,
are marked
expiredand lose any content they held.