New to Kendo UI for Vue? Start a free 30-day trial

UploadProps

Interface

Represents the props of the Kendo UI for Vue Upload component.

Definition

Package:@progress/kendo-vue-upload

Properties

accept?

string

Sets the accept attribute of the input element of the Upload.

Sets the layout of the action buttons (see example).

Default:

'end'

Sets the id of one or more elements that describe the Upload, similar to the HTML aria-describedby attribute. For example, these elements can hold an error or a hint message.

Sets the id of one or more elements that label the Upload.

Uploads the selected files right away. To upload the files later, set autoUpload to false.

Default:

true

batch?

boolean

Uploads all files from one selection in a single request. Files that you select one after the other upload in separate requests.

Default:

false

Sets a CSS class on the root element of the Upload.

Sets the initial list of files that the Upload shows in uncontrolled mode (see example).

disabled?

boolean

Disables the Upload (see example).

Default:

false

Sets the list of files that the Upload shows in controlled mode (see example).

id?

string

Sets the id of the Upload.

Sets a custom template for each item in the file list (see example). Accepts a Vue component, a render function, or a slot name. The template receives the UploadListItemProps.

multiple?

boolean

Lets you select more than one file at a time (see example). When you set it to false, you can select only one file at a time.

Default:

true

onAdd?

(event: UploadOnAddEvent) => void

Fires when you select new files for upload.

Parameters:eventUploadOnAddEvent

Fires before the Upload sends a remove request. Use it to add extra data to the request.

Fires before the Upload sends an upload request. Use it to add extra data to the request.

Fires when you click the Remove button while a file is still uploading. Use it when you set saveUrl to a function, so you can cancel your custom requests.

Parameters:eventUploadOnCancelEvent

Fires when the upload progress of a file changes.

Parameters:eventUploadOnProgressEvent

Fires when you remove files. When the Upload sends a request, the event can contain the server response.

Parameters:eventUploadOnRemoveEvent

Fires when the status of the files changes. When the Upload sends a request, the event can contain the server response.

Sets the FormData key that holds the list of file names that the Upload sends to removeUrl.

Default:

'fileNames'

Sets the HttpHeaders that the Upload attaches to each remove request.

Default:

{}

Sets the request method of the remove request.

Default:

'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 takes its name from the removeField property. It holds the list of file names to remove.

Default:

''

responseType?

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

Sets the expected response type of the server. The Upload uses it to parse the response.

Default:

'json'

Sets the restrictions for the selected files (see example).

Default:

{ allowedExtensions: [], maxFileSize: 0, minFileSize: 0 }

Sets the FormData key that holds the files that the Upload sends to saveUrl.

Default:

'files'

Sets the HttpHeaders that the Upload attaches to each upload request.

Default:

{}

Sets the request method of the upload request.

Default:

'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 FormData key takes its name from the saveField property and holds the list of files to upload.

Default:

''

Shows or hides the action buttons. This property works only when you set autoUpload to false.

Default:

true

Shows or hides the list of files.

Default:

true

tabIndex?

string | number

Sets the tabindex of the Upload.

Sets a function that applies custom restrictions to the selected files (see example).

Parameters:fileUploadFileInfo

Sets whether the Upload sends credentials, such as cookies and headers, with cross-site requests. This property has no effect on same-site requests. To add credentials to the request, use the saveHeaders or removeHeaders property.

Default:

true