DocsFiles & media
On this page

Show upload progress

Display upload progress and replace saved attachments.

Before you begin: Upload files with a record.

Upload Progress

onUploadProgress receives one event per file. It includes the post id, field path, file identity, status, bytes, percentage, and whether the upload can be resumed.

js

Reference excerpt: use this with the page, variables and functions described in this guide. Try a complete example →

Progress events look like this:

js

Reference excerpt: use this with the page, variables and functions described in this guide. Try a complete example →

Frontbacked also emits browser events:

js

Reference excerpt: use this with the page, variables and functions described in this guide. Try a complete example →

The video-specific event is only emitted for video files. The general upload event is emitted for every file type.

Stored File Shape

After upload, file fields contain a permanent managed identity:

js

Reference excerpt: use this with the page, variables and functions described in this guide. Try a complete example →

Video files also retain mediaId. Keep both IDs and the rest of the stored metadata when copying a file into another record or a purchase snapshot. Reads may include temporary upload progress or media playback details; these do not replace the permanent IDs. See Adaptive Video for playback fields.

Uploads complete before the post is saved. If an upload or the save fails, keep the draft and its selected files; submitting that draft again reuses matching upload sessions. Completed uploads that remain unattached have a 24-hour retry window.

Remove or Replace Files

For an edit form, update the draft array and save the retained files together:

js

Reference excerpt: use this with the page, variables and functions described in this guide. Try a complete example →

To replace a photo, put the newly selected browser File into that position in the submitted array. Other items remain stored file objects; they are not uploaded again. Reordering files deletes nothing.

For an immediate action, call Frontbacked.removePostFiles({ id, type, files: [savedFile] }). You can pass several saved files or permanent file-ID strings. To remove an optional single field during an ordinary edit, use Frontbacked.empty.UNSET.

Edit permissions, hooks and schema validation still apply. A required attachment or minimum array size can prevent removal. After a successful save, Frontbacked cleans up removed managed files and generated variants only when no saved references remain. Failed storage deletions retry automatically. External files are never deleted; old URL-only metadata is not adopted into managed cleanup.

Continue with Resume an interrupted upload.