Skip to content

File Upload Field Type

Description

Allows the user to modify the user-supplied supporting files associated with the respective form.

Additional Properties

The field has the following additional properties that can be defined while creating it

  • Whether user can upload a file: Toggle to allow or deny file upload
  • Whether user can take a photo with the device camera: Opt-in camera/selfie capture. Requires a configured camera-compatible output type: jpg, jpeg, png, or webp.
  • Whether user can delete an existing file: Toggle to allow or deny deletion of an uploaded file
  • Whether user can download an existing file: Toggle to allow or deny download of an uploaded file
  • Semi colon separated list of supported data types: List allowed data types for upload separated by semicolon
  • Whether to store this document as a separate attachment record or in a field within the target data store (native): Toggle to store natively within a field or as a separate record within the data store.
  • Auto Upload: Toggle to allow or deny auto-upload of the file without explicitly clicking the upload button
  • Show Preview for Content: Toggle to show a preview before or after upload
  • Hide on Summary: Hide the field from the summary page
  • Delete Value when Hidden: Delete the field value if the field is hidden

Events

A File Upload field supports events at these points in its upload lifecycle:

Event pipeline When it runs Typical uses
Before Document Upload After a valid file is selected and its content is available to the form, before the upload is completed Inspect or send file content to an integration, populate metadata, prepare related form values, or display information derived from the selected file.
After Document Upload After the file has uploaded successfully Classify or tag the uploaded file, populate related fields, run a downstream integration, update a status, or notify another system that the document is available.

An After Document Upload pipeline completes before upload auto-save begins. Values produced by linked events can therefore be included in the saved form data.

Both pipelines can contain multiple linked events. Use their order to express dependencies—for example, run an integration and then use Set Field Value to apply its result. General event behavior, including Set Field Value target scope, is described in Events on a Form.

When this field is in a repeating/grouping section, the row containing the selected file supplies the event context. Events configured on the field apply to every generated row.

Pass file content to an Integration Workflow

Any form event that calls an Integration Workflow can map this field's File Content (Base64), File Name and Content Type to workflow inputs, including a button click and both upload pipelines. These values are available for the current file in Before Document Upload, before it has a saved document ID, as well as after a successful upload. If no local selection remains, the form retrieves the saved document before calling the workflow, including after a refresh. A new local selection takes precedence. Metadata is supplied where available.

See Pass Files to Integration Workflows for input settings, event mappings and workflow request mapping. Existing Doc Body (Data URL) mappings retain their behavior.

Validations

Uploaded file validation

The form checks the selected file's extension and size before uploading it. These browser checks mirror the form's published allowed file types and maximum file size; the server repeats the checks and remains the final authority. When no maximum is configured, the default is 5 MB.

PDF and common raster-image files can be previewed. Other accepted file types are shown as a file row and can be downloaded instead of being embedded in the page.

When camera capture is enabled and an image type is allowed, the field displays the theme-controlled Take selfie action. The built-in button has the npo-selfie-button class, and its label is supplied by [[COREMETA_FIELDTAKESELFIEBUTTONLABEL]] in the DEM Theme template. The browser asks for camera permission only after the user selects that action. The user can retake, cancel, or explicitly use the photo; the normal upload validation and upload events then apply. HTTPS is required for live camera access. On mobile, the device camera picker is also available as a fallback.

The field supports the following validations to govern the values (files) permitted in the field.

  • Required: Toggle to make the field mandatory or not.
  • Conditional Validation: Specify custom conditions that should be satisfied on the field value with an accompanying error message to be displayed if the condition is not met.