Skip to main content

Upload

Ask AIView as Markdown
Copy a prompt to ask an AI assistant about this page.

Uploads allow users to select and upload files from their device via drag-and-drop.

Upload - Code

Basic​

API for ix-upload​

Properties​

Description

The accept attribute specifies the types of files that the server accepts (that can be submitted through a file upload).

See https://www.w3schools.com/tags/att_input_accept.asp

Attribute
accept
Type
string | undefined
Since 5.1.0
Description

If directoryUpload is true the user can drop or select a folder containing one or more files

Attribute
directory-upload
Type
boolean
Default
false
Description

Disable all input events

Attribute
disabled
Type
boolean
Default
false
Description

Text for disabled state

Attribute
i18n-upload-disabled
Type
string
Default
'File upload currently not possible.'
Description

Label for upload file or folder button

Attribute
i18n-upload-file
Type
string | undefined
Description

Will be used by state = UploadFileState.LOADING

Attribute
loading-text
Type
string | undefined
Description

Whether the text should wrap to more than one line

Attribute
multiline
Type
boolean
Default
false
Description

If multiple is true the user can drop or select multiple files

Attribute
multiple
Type
boolean
Default
false
Description

Will be used by state = UploadFileState.SELECT_FILE

Attribute
select-file-text
Type
string | undefined
Description

After a file is uploaded you can set the upload component to a defined state

Attribute
state
Type
UploadFileState.LOADING | UploadFileState.SELECT_FILE | UploadFileState.UPLOAD_FAILED | UploadFileState.UPLOAD_SUCCESSED
Default
UploadFileState.SELECT_FILE
Description

Will be used by state = UploadFileState.UPLOAD_FAILED

Attribute
upload-failed-text
Type
string
Default
'Upload failed. Please try again.'
Description

Will be used by state = UploadFileState.UPLOAD_SUCCESSED

Attribute
upload-success-text
Type
string
Default
'Upload successful'

Methods​

Events​

Description

You get an array of Files after drop-action or browse action is finished

Event
filesChanged
Detail
File[]