The upload element

Release 2.0 - ...

This form control enables the common feature found on Web sites to upload a file from the local file system.

This element is usually rendered as an (x)html input element with type="file".

Example

XML CopyCode image Copy Code
<xforms:upload mediatype="image/jpg" ref="/car/pic">
  <xforms:label>Upload an image: </xforms:label>
</xforms:upload>

Attributes

Name Required / optional Description
mediatype optional Space-separated list of suggested media types, used by the XForms Processor to determine the possible sources of data to upload.
incremental optional When true, this form control will generate additional xforms-value-changed events. The default is false.
Common Attributes optional Any attribute from the Common Attributes collection (e.g. id).
Single Node Binding Attributes required One or more attributes from the Single Node Binding Attributes group (ref, model, bind).
UI Common Attributes optional Any attribute from the UI Common Attributes group (appearance, class, navindex, accesskey).

Content

Within an upload element, the following child elements are allowed:

Element Name Required / optional Description
label required Provides a descriptive label for the containing form control
help optional Provides a help message for the containing form control.
hint optional Provides a hint message for the containing form control.
alert optional Provides an alert or error message for the containing form control.
Action element(s) optional Any element from the Action Elements Collection.
filename optional Specifies the location in the instance to place the filename of the chosen binary resource.
mediatype optional Specifies the location in the instance to place the mediatype of the chosen binary resource.

Specification

Link to the XForms specification: the upload element.

Topics