OpenWGA 7.6 - WebTML reference

WebTML tags » input

<tml:input type="file" >

Purpose:

Provides an upload dialog for a file attachment.

Description:

Files which will be uploaded via the generated dialog are accessible by their name on the TMLForm object. Further the name of the file is stored in a form field specified by the attribute 'name' on the input tag.

By calling tmlform.attach() the uploaded file can be attached to the source document of the form.

Examples:

The following example provides an upload dialog for an image. The uploaded images is attached to the document and displayed.
<tml:action id="save">
    tmlform.storeInContent(content());
    tmlform.attach(content());
    content().save();   
</tml:action>

Please specify an image to upload here: <tml:input name="myImage" type="file"/><br>
<tml:button clickaction="save">upload</tml:button><br>
<hr>
Image from document:
<tml:image item="myImage"/>