UploadOptions
Defined in: types.ts:121
Options for ServiceClient.upload() — a multipart/form-data request for @mantlejs/storage’s handleUpload().
Properties
Section titled “Properties”field?
Section titled “field?”
optionalfield?:string
Defined in: types.ts:125
Multipart field name handleUpload(field) reads.
Default
Section titled “Default”"file"fields?
Section titled “fields?”
optionalfields?:Record<string,string>
Defined in: types.ts:127
Ordinary form fields sent before the file part (merged into context.data by handleUpload()).
filename?
Section titled “filename?”
optionalfilename?:string
Defined in: types.ts:129
Filename sent with the file part. Default: the File’s own name, or "blob".
headers?
Section titled “headers?”
optionalheaders?:Record<string,string>
Defined in: types.ts:139
Per-request header overrides.
optionalid?:Id
Defined in: types.ts:123
Upload into an existing record: PATCH /:service/:id instead of POST /:service.
onProgress?
Section titled “onProgress?”
optionalonProgress?: (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.
Parameters
Section titled “Parameters”progress
Section titled “progress”Returns
Section titled “Returns”void
signal?
Section titled “signal?”
optionalsignal?:AbortSignal
Defined in: types.ts:137
Abort the upload; rejects with the signal’s reason (an AbortError by default).