UploadFileEventSchema
Uploads the file carried in the event's incomingData to url with method, headers and contentType, reporting progress as it goes. Pair it with OpenFilePicker or GetFile using their PlatformFile output.
Response shape: a JSON content type is parsed into plain maps, lists and primitives; anything else is passed through as raw bytes. A JSON body that fails to parse yields null.
incomingData consumed: required, and must be a PlatformFile — it is the file uploaded.
Triggers fired:
OnStartEventTrigger— after incomingData was validated, before the upload begins.OnUploadProgressEventTrigger— repeatedly while uploading, with the progress passed as incomingData.OnNetworkResponseEventTrigger/OnNetworkFailureEventTrigger— when this event declares an event wired to the response's exact HTTP status: the first for successful statuses, the second for the rest. The parsed body is passed as incomingData.OnSuccessEventTrigger— when the upload succeeded and no status-specific event was declared; the parsed body is passed as incomingData.OnFailureEventTrigger— when incomingData is not aPlatformFile(fired beforeOnStartEventTrigger, with no data), when the response is unsuccessful and no status-specific event was declared (the parsed body is passed), and when the upload itself fails (theThrowableis passed). Failures are logged.
Constructors
Properties
This event's own children — each declaring, via its own trigger, which of this event's outgoing triggers runs it. null when this event declares no children.
The condition that must occur for this event to run — matched by structural equality (data class/data object equality) against whatever trigger value fired, never by any kind of subscription or listener registry.