GetFile

fun EventSchemaBuilderScope.GetFile(id: String = randomId(), trigger: EventTrigger, events: EventSchemaBuilderScope.() -> Unit = {}, fileName: String, outputType: FileOutputType = arrayOfBytes())

Reads the file stored under fileName from the client's own file storage and emits its content downstream, shaped by outputType. Does not consume incomingData. Dispatches onSuccess (carrying the content, shaped by outputType) when the file was read; onFailure (carrying the Throwable, logged) when the read failed, no file exists under fileName, or mapObject() decoding fails.

Parameters

id

Unique identifier of this event. Defaults to a random id.

trigger

Trigger that fires this event, built via EventTriggers.

events

Child events chained after this one, wired to its triggers (onSuccess, onFailure).

fileName

Name of the file to read.

outputType

Shape of the content delivered as incomingDataarrayOfBytes, flowOfBytes, platformFile, mapObject or base64. Defaults to raw bytes.