capture-file (legacy docs)

These capture-file docs are out of date

New functionality and features were added to capture-file in version 4.80.0 of the JourneyApps Runtime. Please refer to the latest docs here.

The Capture File component allows users to upload a file from the device.

Container compatibility

The capture-file component currently only works on the Windows JourneyApps Container version 4.6 and higher, and Android and iOS from from 4.43 and higher.

Example

<!-- Variables go here: -->
<var name="current_file" type="attachment" media="application/pdf" />

<!-- Components go here: -->
<capture-file bind="current_file" required="false" />

Configuration

The <capture-file> tag accepts the following configuration options:

OptionRequiredDetails

bind

required

Variable/field in which to store the file. Must be a variable or field of type attachment.

label

required

Text to display on the capture-file component before a file is selected. It can be a format string to make the text dynamic. If not specified, defaults to the value of the field specified in bind. To have no label, specify label="".

required

optional

true if a file must be selected before proceeding to another view. Defaults to false.

on-capture

optional

The JavaScript/TypeScript function call to be performed when the file is captured. (Added with v4.40.5 of the JourneyApps Container)

show-if

optional

Controls whether the component is hidden or shown. The argument specified to show-if can either be a literal boolean value (true or false), or it can specify a variable, parameter or field that can be a string, number, object, etc. that evaluates to false or evaluates to true. If the component also specifies required="true", but it is hidden, the validation will be ignored/skipped.

hide-if

optional

The opposite of show-if (see above).

Last updated