File Upload

A versatile file upload component that supports single and multiple file uploads with preview capabilities. Features support for image previews, progress tracking, drag-and-drop functionality, and various upload methods including S3 and local storage. Includes file type validation and custom upload handlers.


Extends: fieldComponent


Fields

Name

Code

Data Type

Description

Access Function ID

accessFunctionId

text

Unique identifier for access control functions

Multi Uploader

useMultiUploader

boolean

Enables multiple file upload capabilities

Custom Tags

customTags

text

Additional tags for customizing upload behavior (#multiple)

Image Preview

imagePreview

boolean

Enables preview for uploaded image files

Upload Headers

uploadHeaders

object

Custom headers for upload requests

Bucket Config

bucketConfig

object

Configuration for S3 bucket uploads

Allowed File Types

allowedFileTypes

text

List of accepted file extensions

Max File Size

maxFileSize

text

Maximum allowed file size

Upload URL

uploadUrl

text

Custom upload endpoint URL


Methods

Name

Description

getFiles

Retrieves the list of uploaded files

removeFile

Removes a specific file from the uploaded files list

clear

Clears all uploaded files and resets the uploader

fileDownload

Initiates download of a specific uploaded file

isImage

Checks if the uploaded file is an image based on its extension

getFileName

Extracts and returns the file name from the file path


Events

Name

Description

onChange

Triggered when files are added or removed

onBlur

Triggered when the upload component loses focus

onFocus

Triggered when the upload component gains focus

onUploadStart

Triggered when file upload begins

onUploadComplete

Triggered when file upload completes

onUploadError

Triggered when an upload error occurs

onFileAdded

Triggered when a new file is selected

onFileRemoved

Triggered when a file is removed