Skip to content

UploadOptions

Defined in: types.ts:121

Options for ServiceClient.upload() — a multipart/form-data request for @mantlejs/storage’s handleUpload().

optional field?: string

Defined in: types.ts:125

Multipart field name handleUpload(field) reads.

"file"

optional fields?: Record<string, string>

Defined in: types.ts:127

Ordinary form fields sent before the file part (merged into context.data by handleUpload()).


optional filename?: string

Defined in: types.ts:129

Filename sent with the file part. Default: the File’s own name, or "blob".


optional headers?: Record<string, string>

Defined in: types.ts:139

Per-request header overrides.


optional id?: Id

Defined in: types.ts:123

Upload into an existing record: PATCH /:service/:id instead of POST /:service.


optional onProgress?: (progress) => void

Defined in: types.ts:135

Upload progress. When set and XMLHttpRequest exists (browsers, React Native), the request goes over XHR — fetch can’t report upload progress. Otherwise fetch is used and this is never called.

UploadProgress

void


optional signal?: AbortSignal

Defined in: types.ts:137

Abort the upload; rejects with the signal’s reason (an AbortError by default).