Skip to main content
storeFile uploads a file to the workspace’s object-store bucket and returns either a signed URL (private, expiring) or a public URL (permanent). Use it from a Form block with a file input to capture user uploads, or from a page-side handler to store generated content. By the end of this page you can wire a Form to accept an upload and render the returned URL — no manual bucket setup required, since every workspace gets its own object-store bucket auto-provisioned.

Invoke from a Form block

Attach a file field to a Form block and bind storeFile to on_submit. The runtime passes the uploaded file’s bytes as body.
upload-form.json
{
  "block": "Form",
  "props": {
    "schema_table": "uploads",
    "fields": ["label", "file"],
    "on_submit": {
      "capability": "storeFile",
      "args": {
        "filename": "avatar.png",
        "content_type": "image/png",
        "body": "iVBORw0KGgoAAAANSUhEUgAA...",
        "expires_in_seconds": 86400
      }
    }
  }
}
In real usage the file field’s name, MIME type, and base64-encoded bytes come from the submitted form rather than literal strings — the runtime substitutes them at dispatch time.

Inputs

Outputs

Provisioning

No manual setup. Every workspace gets a dedicated object-store bucket on first use. Files are scoped to the workspace and are not accessible across workspace boundaries.
Signed URLs expire. The default TTL is one hour (expires_in_seconds: 3600). A URL used after uploaded_at + expires_in_seconds returns 403. To serve the same object again later, store object_key from the upload response and request a fresh URL when needed.

Error codes

Every error returns the standard envelope:

authUser

Read the signed-in user’s profile to associate uploads with the user.

File uploads guide

End-to-end walkthrough: Form block, file field, and rendering the result.