UploadFile
A host-provided file payload for every host-rendered upload. A plain class, not a data class: it has identity equality, so the enclosing StepInput values do too — never compare upload inputs by value.
Constructors
Properties
MIME type, e.g. "image/jpeg" or "application/pdf". It labels the upload; Engine and the backend decide what the file is from its bytes.
Opens a fresh, readable stream of the bytes, on a background thread. Engine calls this more than once — to check the file's first bytes, then to send it — so it must return a NEW stream each time; Engine closes every stream it opens. Whatever it throws while Engine checks the file, Engine treats the file as unreadable, like an empty one. A stream keeps a large file out of memory; a small in-memory payload is UploadFile(type, name, bytes.size.toLong()) { bytes.inputStream() }.