OpenWGA 7.6 - OpenWGA Concepts and Features

Design and development » WebTML » Features » Forms

Form files

Besides fields a WebTML form is also able to manage files. Normally these are files that are uploaded by the form users.

To upload a file to a form a <tml:input> of type="file" must be used, which shows a simple HTML file upload control.

After uploading the file is kept on the server side along with the process context of the form. This means that it will stay while the user uses WebTML actions to work on the form, across an unlimited number of requests. In TMLScript there are many methods to work with those form files like tmlform.fileNames or tmlform.getFile().

The form stores files keyed by their (case insensitive name). This means that uploading a file with the same name as an existing form file will replace the existing one.

Synchronizing form files on source "content"

When the backend of a WebTML form is a content document then the form will automatically synchronize form files and document attachments.

This means that if the document has file attachments these will also be available on the WebTML form as form files automatically. Removing such a file on the form will also remove the corresponding file attachment on the document when the form data is stored back to the data source, for example via default action $store. Updating a file on the form that originated from a document attachment will also update this attachment once the form data is stored back. Newly added files will get added to the document as new file attachment.