Media / foldkit-media/browser

upload

function · packages/media/src/browser/upload.ts:78

function upload(
  file: Blob,
  options?: UploadOptions,
): Stream.Stream<UploadEvent, UploadFailed>

Sends file to the upload route as its body, which the browser types by the file's own type: Progressed as the bytes go, then one Uploaded with the facts, and the stream ends. A refusal fails it with UploadFailed, naming why; a file the route does not take as an image is Unsupported. Interrupting it aborts the request.