StableAction
Upload file
Overview
Opens the file picker, uploads the chosen file to your app's storage and keeps its URL for the next actions.
Purpose
Use it when you want an upload outside a form — attach a photo to the current job, add a document to a customer — and then save the URL with Update record.
Inputs
- Accepted types — a comma-separated list such as
image/*,.pdfto filter the file picker. - Save URL as result — result key (default
file) under which the uploaded file's URL is stored.
Configuration
- Follow it with Update record or Create record that sets a File/Image field to
Action results › file. - Inside forms, prefer the File Upload / Image Upload / Camera inputs, which store the file as part of the form submission.
Outputs
- Action results › file (or your key) and last result — the public URL of the uploaded file, ready to store in a File or Image field.
Example
Attach a photo to a job
Example
Button “Add photo” (on /jobs/:id) › On click:
1. Upload file
Accepted types: image/*
Save URL as result: photo
2. Update record
Entity: Jobs · Which record: Page parameters › id
Set fields: Photo = Action results › photoErrors
- “Please sign in to upload files.” — anonymous uploads are only allowed when the Public role has create permission on some entity.
- “Files must be under 15 MB.” and “This file type is not allowed.” — size and type checks on the server (the content is sniffed, not just the extension).
- Cancelling the file picker stops the action list silently.
Limitations
- One file per action. Rate limited to 60 uploads per 10 minutes for signed-in users (15 for visitors).
- Files are stored per environment (test vs live).
Advanced
- Schema:
{ type: "upload_file", accept?, resultKey? }. Browser-side: creates a hidden<input type=file>, then POSTs to/api/runtime/<project>/files; the result is{ id, url, name, size, mimeType }andurlis stored.