<fileupload/>


Description

The file upload widget is a labelled input widget that allows users to upload files and bind the uploaded values to object instance attributes. 

Specifying a file to upload can be done by browsing the file system on your pc. This behaviour is triggered by clicking the folder icon on the top right corner of the widget.

In addition, a file can be dragged and dropped in the widget area labelled as "Drag & drop here"

When uploading a file, the progress is indicated by a progress bar. 

Once a file has been uploaded the file name will be displayed in the widget.

Files that have been uploaded but not yet submitted can be removed from the widget using the trash can icon on the bottom right corner of the widget.

The title is specified as a key to a lang file entry and is required. A tooltip can also be specified as a key to a lang file entry but is optional. Visibility bindings are also supported.

A new addition in version 1.57.0 (specific to the new UI) is the description attribute. The description attribute works similarly to the title in that it is specified as a key to a lang file entry, however, its purpose is to allow for additional information related to an input and will appear beneath the input.


Example

The abbreviated code snippets and screenshot below shows the use of <fileupload/> with a value binding to an object instance attribute.

Model object attribute
persistent object Farmer {
    .
    .
    blob governmentAssistanceCertificate;    
    .
    .
}
View XML
 <fileupload label="fileupload.government_assistance_recipient_certificate">
    <binding variable="farmer">
        <attribute name="governmentAssistanceCertificate"/>
    </binding>
</fileupload>
Backing unit
Farmer farmer;
void init() {
    farmer = Farmer:user();
}
en.lang file entry
fileupload.government_assistance_recipient_certificate = Government Assistance Recipient Certificate:

<fileupload> example screenshots




Additional Mentions and References