Upload Button
import {UploadButton} from 'cx/widgets';Upload buttons are used for selecting files and uploading them to the server.
<div class="widgets">
<UploadButton
icon="upload"
url="https://api.cxjs.io/uploads"
onUploadStarting={onUploadStarting}
onUploadComplete={onUploadComplete}
onUploadError={onUploadError}
>
Upload
</UploadButton>
</div>| Property | Description | Type |
|---|---|---|
method | HTTP request method. Default value is | string |
multiple | Set to | boolean |
onResolveUrl | A callback function used to resolve dynamic upload URLs which are sometimes necessary for cloud uploads. Arguments:
Return value should be a string or a promise that resolves to a string. | function |
onUploadComplete | A callback function called when the upload is complete. Arguments:
Check | function |
onUploadError | A callback function called in case of an upload error. Arguments:
| function |
onUploadStarting | A callback function to validate files to be uploaded. Arguments:
| function |
abortOnDestroy | Set to | boolean |
accept | Defines file types that are accepted for upload. | string |
baseClass | Base CSS class to be applied to the element. Default is 'uploadbutton'. | string |
disabled | Set to | boolean |
text | Text description. | string |