UploadAsyncProps

Represents the async properties of the Upload component.

NameTypeDefaultDescription

autoUpload?

boolean

By default, the selected files are immediately uploaded. To change this behavior, set autoUpload to false.

batch?

boolean

When enabled, all files in the selection are uploaded in one request. Any files that are selected one after the other are uploaded in separate requests.

removeField?

string

Sets the FormData key which contains the list of file names that are submitted to removeUrl. Defaults to fileNames.

removeHeaders?

UploadHttpHeaders

Configures the HttpHeaders that are attached to each remove request.

removeMethod?

string

Sets the request method of the remove request. Defaults to POST.

removeUrl?

string | (files: UploadFileInfo[], options: { formData: FormData; requestOptions: any; }) => Promise<{ uid: string; }>

Sets the URL of the endpoint for the remove request. The FormData request key is named after the removeField property. It contains the list of file names which will be removed.

responseType?

"text" | "arraybuffer" | "blob" | "json"

Sets the expected response type of the server. Used to parse the response appropriately. Defaults to json.

saveField?

string

Sets the FormData key which contains the files submitted to saveUrl. Defaults to files.

saveHeaders?

UploadHttpHeaders

Configures the HttpHeaders that are attached to each upload request.

saveMethod?

string

Sets the request method of the upload request. Defaults to POST.

saveUrl?

string | (files: UploadFileInfo[], options: { formData: FormData; requestOptions: any; }, onProgress: (uid: string, event: ProgressEvent<EventTarget>) => void) => Promise<{ uid: string; }>

Sets the URL of the endpoint for the upload request. The requested FormData key is named after the saveField property and contains the list of files that will be uploaded.

withCredentials?

boolean

Configures whether credentials (cookies, headers) will be sent for cross-site requests. Defaults to true. Setting withCredentials has no effect on same-site requests. To add credentials to the request, use the saveHeaders or removeHeaders property.