Skip to content

File

The File widget selects, uploads, links to, and, where supported, edits one file. Its bound value remains a scalar file reference. Use FileList for a collection or ImageUpload for image confirmation and editing.

XML Fields

  • XPath stores the selected file reference. NameXPath optionally identifies a separate field for the displayed file name.
  • Accept is a comma-separated picker/client filter for extensions or MIME types, such as .pdf,image/*. It does not replace server file policy or authorization.
  • AllowEdit enables supported file-editing integration; SetEditingRevision records edits as a revision when the source supports revisions. RequiredForGroup requires a file when that validation group is checked.
  • DataSources supplies file templates. MonitoredXPaths reloads them when dependent data changes; CacheDataSources controls reuse of loaded template options.
  • Hints supplies help text and Rules controls conditional behavior. File permissions are enforced separately from the form definition.

Data Model

The File widget stores the file ID in the bound data model element. A Caption attribute is automatically created and populated with the file name for display purposes. To map the file name to a specific data model element, use the NameXPath property, evaluated relative to the bound file element's parent.

The runtime can also write Url, Revision, and HasFileRevision attributes. Replacing an existing application file can keep its canonical ID and place the new upload ID in Revision. Preserve these attributes when transforming form data.

File Upload Sources

The File widget supports multiple data sources for uploading files or linking to existing files from various systems. These data sources are configured in the Host Administration Panel.

Desktop Upload

Users can upload files from their local file systems. Uploaded files are subject to security restrictions configured in the Host Administration Panel, such as allowed/denied file types. Antivirus scanning is performed if configured.

Camera Upload

Files can be captured directly from a device's camera where browser/device support and permission allow it. ImageUpload adds its own confirmation and image-processing settings; see ImageUpload.

Cloud Storage Integration (Google Drive, Office 365)

If configured, users can link files from Google Drive or Office 365 OneDrive. Only the file link is stored; the actual file content is not replicated within Emakin.

Clipboard and Drop

The file field and Desktop upload area accept dropped files and file paste events exposed by the browser. The Paste from Clipboard command reads clipboard images where the browser supports it. File remains a single-value field and rejects a multi-file native selection; use FileList for batches.

Recently Used

The source window includes a searchable Recently Used tab for up to 20 files uploaded by the current user in the current domain. References expire after 30 days of their last recorded use. Reuse creates an independent copy; removing a history entry leaves the source file intact. This source requires file-read permission and reuse also needs file-write permission. It is unavailable in local-only operation.

Recently Used opens first for an ordinary source window. When local files are already selected or dropped, Desktop opens to keep transfer progress and errors visible. See Adding Files and Images for user-facing steps.

File Templates

The File widget supports file templates for creating new files based on pre-defined content. When a template is selected from an application file ID, a new copy is generated and associated with the form. A template whose value is an HTTP URL is linked instead. Templates are specified through data source configuration; Value supplies the file ID or URL, and Text supplies the displayed name.

Template Data Sources Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
<File XPath="MyFile" NameXPath="" RequiredForGroup="" CacheDataSources="True" AllowEdit="True" SetEditingRevision="False">
    <DataSources>
        <ListItemDataSource TextFormat="" ValueFormat="" Enabled="True">
            <Items>
                <Item>
                    <Text><![CDATA[word]]></Text>
                    <Value><![CDATA[8ede8093-fb87-4f6a-85c0-4fca354f5af4]]></Value>
                </Item>
                <Item>
                    <Text><![CDATA[excel]]></Text>
                    <Value><![CDATA[b1a82c67-670d-411e-bc60-5483786ff41f]]></Value>
                </Item>
            </Items>
        </ListItemDataSource>
    </DataSources>
    <MonitoredXPaths />
    <Hints><![CDATA[]]></Hints>
    <Rules />
</File>

File Editing

Depending on configuration, the File widget may support in-place document editing using a WOPI-compatible editor, eliminating the need to download, edit, and re-upload files. Editor integration is managed in the Host Administration Panel. Set AllowEdit="False" to disable the supported file-editing integration.