Upload
The Upload Files action allows you to upload one or more files to a remote API endpoint. It provides full control over the upload stream and supports custom success and error handling, along with advanced options like cancel tokens and stream controllers.
Use Cases
Uploading user-selected images, videos, or documents to a server.
Triggering uploads after form submissions.
Handling upload success and failure scenarios programmatically.
Properties
dataSource
The API endpoint used to upload the file(s).
successCondition
A boolean expression used to determine if the upload was successful.
onSuccess
Action flow to run when the upload succeeds and successCondition
is met.
onError
Action flow to run when the upload fails or successCondition
returns false.
streamController
An optional expression to pass a custom stream controller to track progress or state.
cancelToken
An optional expression used to allow cancellation of the upload request.
Default Behavior
Sends file data to the provided
dataSource
using a multipart/form-data request.Monitors the response based on
successCondition
.Executes
onSuccess
oronError
based on the upload result.Supports optional stream control and cancellation for advanced usage.
How to Use
Attach the action to a widget event (e.g., after file selection or form submission).
Select Upload Files from the action list.
Configure the
dataSource
with your upload API.Optionally define a
successCondition
,onSuccess
, andonError
.Use
streamController
orcancelToken
if you need fine-grained control over the upload lifecycle.
Last updated