Attachments - UploadFile

File attachment component for the application

Component properties

Eximee Designer property
Attribute name in Source
Description

Maximum number of attached files (section Basic properties)

numberOfUploadingFiles

The number of files that can be uploaded in the component, default 1.

Number of required attachments (section Data quality)

requiredCount

The required number of files to attach - default 0. If 0, no file needs to be attached; if greater, it depends on the given number.

Text displayed when required attachments are missing (section Data quality)

requiredCountError

Mandatory message, required if the property is defined Number of required attachments (requiredCount).

Maximum file size (section Data quality)

maxFileSize

Maximum file size in KB. Default 1024 KB.

Maximum total size of all files (section Data quality)

maxTotalFilesSize

Maximum size of all attached files in KB. Default 10240 KB.

Show list of allowed extensions (section Interactions)

showExtensionList

Enable the option to display information about allowed formats and the maximum size of the uploaded file (option is disabled by default). Example information: "Allowed attachment formats: pdf (max. 1 MB)"

Enable image compression (section Interactions)

imageCompressionEnabled

Ability to compress images (default value "false").

Maximum webcam photo width (section Interactions)

maxWebcamWidth

Feature availability depends on the license and may not be available in all deployments. Maximum width of a webcam photo in pixels.

Maximum webcam photo height (section Interactions)

maxWebcamHeight

Feature availability depends on the license and may not be available in all deployments. Maximum height of a webcam photo in pixels.

Ability to attach a photo taken with the camera (section Interactions)

webcamEnabledCondition

Feature availability depends on the license and may not be available in all deployments. Condition that enables/disables the ability to upload a photo taken with the device's built-in camera.

List of allowed file extensions (section Security)

validExtensionList

Formats of allowed file extensions, listed comma-separated, e.g.: jpg, jpeg, png, pdf.

Additional PDF file validation (section Security)

validateContent

Additional validation of the file for PDF FORMAT, not just the file extension.

Regular expression to validate the file name (section Security)

allowedFilenameRegexp

Regular expression checking allowed file names. It is possible to override the default validation error message by adding the key to the application translations iew.gwtupload.invalid_filename and setting a new translation value.

Ability to attach descriptions to attached files (section Other)

attachmentWithDescription

Feature availability depends on the license and may not be available in all deployments. Displays a description field for each added attachment. Property is disabled by default (set to "false").

Maximum number of characters for attachment descriptions (section Other)

attachmentDescriptionMaxLength

Feature availability depends on the license and may not be available in all deployments. Maximum length of the description that can be entered for an added attachment. Default 120 characters.

Button label (section Other)

buttonLabel

Feature availability depends on the license and may not be available in all deployments. Text displayed on the add file button.

Field description (section Other)

description

Feature availability depends on the license and may not be available in all deployments. Description text.

Enable image compression (section Other)

Feature availability depends on the license and may not be available in all deployments. Property allowing reduction of attached images.

Document type - advanced integration (section Other)

documentType

Technical field used for advanced integration (requires additional implementation). Feature availability depends on the license and may not be available in all deployments.

Contact number - advanced integration (section Other)

contractNumber

Technical field used for advanced integration (requires additional implementation). Feature availability depends on the license and may not be available in all deployments.

Process type (section Other)

processType

Name of the process passed to the service that stores the attached file in an external resource. Feature availability depends on the license and may not be available in all deployments.

Calling an external validator for the added file

singleFileValidator

Calling an external validator for the added file. The validator is called when attempting to add each file (if the attachment does not pass validation it is rejected). The property should be added from the XML Source level.

More information about component properties: Common component properties

Using the component

1

Adding a file

To import a file using the component Attachments, you need to click the Add file. This will open the system file chooser window. After selecting a file it will be imported. After the import completes the file name will appear on the list.

2

Deleting a file

Imported files can be deleted by clicking the Delete button visible next to the file name.

Illustration 1. Example appearance of the component on the form

Illustration 2. Sample appearance of the component with an uploaded attachment

Descriptions for attached files

The availability of features depends on the license and may not be available in all deployments.

You can add a description to an attached file. To do this, check the Ability to attach descriptions to attached files (attachmentWithDescription) (field is disabled by default). The length of the added description can be set in the Maximum number of characters for attachment descriptions (attachmentDescriptionMaxLength).

Component input parameters

Property
Description

maxFileSize

Maximum file size in bytes

validExtensionList

List of allowed extensions (one extension per line)

maxWebcamWidth

Maximum webcam photo width in pixels

maxWebcamHeight

Maximum webcam photo height in pixels

Component output parameters

Property
Description

totalFilesSize

Sum of sizes of all files added using the uploader component

fileNames

Retrieves the names of files added to the control. Data is returned in JSON format: ["fileName1", "fileName2", ...]

externalIds

File identifiers from an external service, similarly to above are returned in JSON format.

If we want to display the total size of all files in a component, e.g. a Text Field, we can do this using the property DATA SOURCE FROM ANOTHER FIELD (valueSourceId) of the component that should display the value. For this purpose the property DATA SOURCE FROM ANOTHER FIELD we assign the following value: GesUploadFile1$totalFilesSize where GesUploadFile1 is the identifier of the attachment component, and totalFilesSize is the property of that component whose value will be entered. Overwriting the value also requires listening to the attachment component.

Defining a component clear action

For the component it is possible to define on the main application template an action that clears the component of the attached file. More information in Actions.

Demo application: demoUploadFile

Last updated

Was this helpful?