File upload

(part of package 'Servoy Extra Components') Extends designtime/SolutionModel: JSWebComponent Extends runtime: RuntimeWebComponent

A Servoy Extra Component that allows users to upload files. It supports multi-file uploads, displays file names, shows upload progress, and provides customizable texts for various upload statuses.

This is a reference page; many components have detailed usage guides here.

Properties

accept

Html accept attribute - defines accepted files to be uploaded. Default is all files. Type: String Default Value: "*/*"


dataProviderID

Bound data provider identifier for the file data. Type: Dataprovider


displaysTags

Flag indicating whether display tags are enabled for the component. Type: Boolean


enabled

Flag indicating whether the file upload component is enabled for user interaction. Type: Enabled Default Value: true


iconStyleClass

CSS style class for the upload icon. Type: Styleclass Default Value: "fa fa-upload fa-3x"


location

The position of the component on the form. Type: Point


maxFileSize

Maximum file size in bytes. Type: Long


multiFileUpload

Flag indicating whether multiple file uploads are allowed. Type: Boolean Default Value: false


resultDisplayTimeout

The result of an upload will be displayed for this amount of time (in milliseconds) before being cleared. After the timeout expires, the upload component will revert to it's initial display state. If set to -1, it will not automatically clear the upload result. Type: Number Default Value: 2000


showFileName

Flag indicating whether the file name is displayed after upload. Type: Boolean Default Value: true


showProgress

Flag indicating whether the upload progress is displayed. Type: Boolean Default Value: true


styleClass

CSS style classes applied to the file upload component. Type: Styleclass


styleClassExpression

Expression that returns additional CSS style classes for the component. Type: Dataprovider


successIconStyleClass

CSS style class for the success icon displayed after a successful upload. Type: Styleclass Default Value: "fa fa-check fa-3x"


toolTipText

Tooltip text displayed when hovering over the file upload component. Type: Tagstring


uploadCancelText

Text displayed when the file upload is canceled. Type: Tagstring Default Value: "Upload canceled"


uploadNotSupportedFileText

Text displayed when the file type is not supported for upload. Type: Tagstring Default Value: "File type is not supported for upload"


uploadNotSupportedText

Text displayed when file drag and drop is not supported by the browser. Type: Tagstring Default Value: "File Drag/Drop is not supported for this browser"


uploadProgressText

Text displayed during the file upload progress. Type: Tagstring Default Value: "Uploading click to cancel"


uploadSuccessText

Text displayed when the file is successfully uploaded. Type: Tagstring Default Value: "Successfully uploaded"


uploadText

Text displayed to prompt the user to upload a file. Type: Tagstring Default Value: "Drop a file here or click to upload"


visible

Flag indicating whether the file upload component is visible. Type: Visible


Events

onDataChangeMethodID(oldValue,newValue,event)

Called when the file upload data changes.

Parameters:

Returns: {Boolean}


onFileTransferFinishedMethodID(event)

Called when the file transfer process is finished.

Parameters:

  • {JSEvent} event The event object associated with the file transfer completion.


onFileUploadedMethodID(jsUpload)

Called when a file is successfully uploaded.

Parameters:

  • {JSUpload} jsUpload The upload object containing details about the uploaded file.


API


Last updated

Was this helpful?