File Component

Before using the File component, please review our Working With Files in Unqork article to better understand expectations and limitations when working with files.
Overview
The File component lets your end-user upload files, like supporting documents or scanned images. This component adds an easy-to-use file uploader element to your applications so end-users can drag and drop files into the component area or use a browse function to select a file to upload.
Here are some scenarios when you'd use a File component:
-
A mortgage application where the end-user needs to upload financial documents.
-
A job application where the end-user uploads their resume.
Once uploaded, files store in a data object. The data object contains the following:
-
The file data is represented as a cloud storage URL (submitted as Base64 or binary).
-
The file type.
-
The file name.
-
The file size.
Uploaded files become available to view, download, or delete as needed. How end-users access the file is intentionally dependent on the end-user’s OS:
-
Desktop (Mac/Windows/Linux): The file opens in the desktop’s native file browser.
-
Mobile (iOS/Android): Mobile devices typically allow the end-user to open the file using their photo library, file app, or camera app.
You'll find the File component in the Data & Event Processing group to the left of the Module Builder.
About the Configuration Window
To learn more about general component settings and those that display when a component is associated with Data Models, view our General Component Settings article.
Display Panel
Field Text
Setting |
Description |
---|---|
Label Text |
Label Text conveys what the input component is and what information it displays. Enter the purpose of the corresponding component or field. User-friendly labels make your module more accessible. Keep labels short and descriptive (a word or two) using title case. For longer entries, use sentence case. |
Contextual Help
Setting |
Description |
---|---|
Tooltip |
A short hint that displays when an end-user positions their cursor over the |
Default State Options
Setting |
Description |
---|---|
Disable User Input |
When set to (ON), end-users cannot interact with or edit the Express View's input field or element. When end-users hover over the field, their cursor changes to alert them to the status change. By default, Disable User Input is set to (OFF). |
Hide Component |
Shows or hides the component from view. Setting the Hide Component toggle to (ON) hides the component in Express View. Setting the toggle back to OFF unhides the component. By default, the Hide Component toggle is set to (OFF). |
Formatting
Setting |
Description |
---|---|
Allow Multiple Files Selection |
When set to (ON), the end-user can select multiple files when browsing for files to upload. By default, this toggle is set to (OFF). |
Display Thumbnail Images of Icons |
When set to (ON), uploaded image files render a preview. When set to (OFF), uploaded files display as text with a file icon. This setting only works when the Parse Files on Upload and Store Data in Database settings are set to (ON). Doing so ensures the component renders the Base64 encoded string of the file. By default, this toggle is set to (OFF). |
Drop Zone Label Text |
Text that guides the end-user to upload a file. The text displays inside the boundaries of the drag and drop area. By default, the text is Drag & drop your files here, or. The Browse Files Link Text immediately follows this text. |
Starting Upload Message |
Feedback text that displays when a file begins to upload. By default, the text displays Starting upload. |
Browse Files Link Text |
The label text for the link allows end-users to browse their computer for files. By default, the link text shows as browse. |
Drag & Drop Not Supported Message |
Text that displays when an end-user's browser doesn't support drag and drop. By default, the text shows as File Drag/Drop is not supported for this browser. |
Header for File Name Column |
The header label for the column lists the individual file names. By default, the header is File. |
Header for File Size Column |
The header label for the column listing the file sizes. By default, the header is Size. |
Adding a File Component
Let's create a basic File component configuration that prompts the end-user to upload a PDF version of their resume.
1. | In the Module Builder, drag and drop a File component onto the canvas. |
2. | In the Property ID field, enter fileResume. |
3. | In the Label Text field, enter Submit Your Resume. |
4. | Navigate to the component's Validation settings. |
5. | Set Required to (ON). |
6. | Navigate to the component's Advanced settings. |
7. | In the Set File Formats to Accept field, enter .pdf. |
By entering .pdf in this field, the component only accepts PDF files from the end-user.
8. | Click Save Component. |
9. | Save your module. |
Preview the module in Express View to view the following functionality:
Data Structure of a File Component
The File component's data stores in submission data as an array of objects. In the example below, the fileResume File component displays the uploaded content in a table. Opening an object in the array displays a set of key/value pairs containing information about the file.
Here's how the File component looks in Express View:
Here's how the same File component looks in the DevTools Console:
Resources