File Component
Estimated Reading Time: 17 minutes
Overview
The File component lets your end-user End-Users are the individuals accessing an application through Express View. In most cases, end-users are the customers using the product. 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 A URL (uniform resource locator) is a unique identifier used to locate a resource on the internet. Also known as a web address. (submitted as Base64 Base64 is an encoding and decoding technique used to convert binary data to an ASCII (American Standard for Information Interchange) text format. 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 OS (operating system) is the program that manages other application programs on your computer.:
-
Desktop (Mac/Windows/Linux): The file opens in the desktop’s native file browser.
-
Mobile (iOS/Android): Mobile devices typically allows the end-user to open the file using the 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 Editor.
File Storage Expectations
Before using the File component, it's important to understand what's required of you when storing files on the Unqork server or when using an external file service.
Storing Files in Unqork
To store files in the Unqork servers, Creators Also known as Unqork users; anyone who is inside the Unqork platform. must set the Store Data in Database setting to (ON). Storing to the Unqork servers provides you with the following advantages:
-
No extra service configuration is needed because files are submitted using Unqork Submission API APIs (application programming interfaces) are a set of protocols and definitions developers use to build and integrate application software. APIs act as the connective tissue between products and services. (application programming interface) calls.
-
Before uploading to the server, the File component ensures all file extensions are correct. It rejects files with incorrect extensions before uploading to the server.
-
After passing any front-end validation, Unqork scans for malware Malware is software designed to disrupt, damage, or gain access to a computer system. before uploading the file to the server.
-
Files are stored in the cloud with no practical storage quota.
-
Only the user who submitted the file using a Cloud Storage Delivery URL has access.
TIP To learn more about Cloud Storage Delivery, see our API documentation: https://developers.unqork.io/#section/Cloud-Storage-Delivery.
Storing Files Externally
To store files using an external file service and a Plug-In component (in other words, outside of the Unqork servers), Creators must set the Store Data in Database setting to (OFF). External file servers include Google Drive, Dropbox, and so on. Consider the following when storing using an external server:
-
Creators must set up an API account with an external file service and configure the service in Services Administration.
-
Creators are subject to the external file service's pricing and usage quotas.
-
Creators and the external file service assume all responsibility for virus scanning. For example, see the documentation for integrating AWS S3 malware scanning in your application: https://aws.amazon.com/blogs/apn/integrating-amazon-s3-malware-scanning-into-your-application-workflow-with-cloud-storage-security/.
NOTE Virus scanning configuration is dependent on the external file service used.
-
Permission to access the files depends on the external file service and its configuration.
How Files Are Represented in Unqork Submission Data
The File component’s submission data Also known as Record Data. Submission data consists of information saved by Unqork components. View submission data by using the angular command, or in Record Collections. is an array of objects, where each object represents a single file. How each object is represented depends on your configuration. There are two main representations:
-
As a Base64 string.
-
As an object stored in the cloud.
Base64 Representation
When the File component's Parse Files on Upload is set to (ON), the file’s data is encoded as a Base64 string that becomes part of the component’s submission data. On submitting to Unqork, the file’s data object updates to a cloud storage link, retrieving and resolving the Base64 string. Therefore, when retrieving the Unqork submission, the file’s submission reduces in size.
Here's an example of a single Base64 file object stored before Unqork submission:
[
{
"storage": "base64",
"name": "Screenshot 2023-03-15 at 15.59.06.png",
"url": "data:image/png;base64,<base64string>",
"size": 16760,
"type": "image/png",
"data": "<base64string>"
}
]
Here's an example of a single Base64 file object stored after Unqork submission:
[
{
"storage": "base64",
"name": "Screenshot 2023-03-15 at 15.59.06.png",
"url": "https://testx.unqork.io/fbu/files/submissionBase64/15f80f953695e1e89a83123b42dc58e8.png?signature=<uniqueSignature>",
"size": 16747,
"type": "image/png",
"data": "https://testx.unqork.io/fbu/files/submissionBase64/94896b69237d0dd91a9f58c5e5d54202.png?signature=<uniqueSignature>",
"imageSrc": "https://testx.unqork.io/fbu/files/submissionBase64/15f80f953695e1e89a83123b42dc58e8.png?signature=<uniqueSignature>"
}
]
NOTE Unless you need to read or display file data in your UI (for example, read data from an XLSX/CSV file or render a thumbnail preview), it is recommended that you avoid storing files as Base64 strings. Base64 is an inefficient way to encode file data and causes a 33% increase in the original file size—and even more for smaller files.
Cloud Storage
When Parse Files on Upload is set to (OFF), the file’s data object becomes a reference, with the file stored in the cloud the moment an Unqork submission is created.
Here's an example of a single file object stored before Unqork submission:
[
{
"storage": "cloud",
"name": "Screenshot 2023-03-15 at 15.13.08.png",
"id": "c83ffe8b-6e90-4920-8e37-44a46f21cf42",
"size": 235157,
"type": "image/png"
}
]
Here's an example of a single file object stored after Unqork submission:
[
{
"storage": "cloud",
"name": "Screenshot 2023-03-16 at 14.23.25.png",
"id": "edd77456-fb52-4664-a2c0-5442fab7c7b7",
"size": 793223,
"type": "image/png",
"data": "https://testx.unqork.io/fbu/files/submissionBase64/c79910d684253c282910315221269d9d.png?signature=<uniqueSignature>"
}
]
File Size Limits
The accepted file size limit depends on the configuration and where you store the file. File size limits are not dependent on the device (desktop/mobile, Windows/Mac, iOS/Android). File size limits are enforced regardless of the value entered in the Set Maximum Size field.
NOTE Any file-related or API request lasting longer than five minutes is not supported and will fail.
If storing the files in Unqork (setting Store Data in Database to (ON)), the file size limit depends on the Parse Files on Upload setting:
-
When Parse Files on Upload is set to
(ON), the file size limit is approximately 18 MB (the entire submission payload). The limit decreases if the Unqork submission contains other component data.
Using the contents Output Type in a Plug-In component to retrieve the base64 of a file has a limit of 10MB. To retrieve a file as base64, consider using the resolveBase64 option or two
Plug-In components with the following settings:
1. | ![]() ![]() |
2. | ![]() |
-
When Parse Files on Upload is set to
(OFF), the file size limit is 100 MB per file.
If storing the files externally (setting Store Data in Database to (OFF)), the file size limit depends on the Plug-In component's multipart request limit:
-
When submitting a file to an external file service using a Plug-In component, the file size limit is 500 MB per file.
TIP Check the external file service's documentation to verify the file size limits accepted by their API.
NOTE For larger files, some external file services require batching (or separating) file upload requests into multiple fragments. The Plug-In component does not support batching file uploads.
File Component Limitations
The following are important limitations of the File component:
-
The File component is not a media player or media renderer. It does not support viewing or playing the files it accepts. The only exception is the Display Thumbnail Images of Icons setting.
-
The File component is not supported inside the following components:
-
Advanced Datagrid component
-
Data Grid component
-
Freeform Grid component
-
Uniform Grid component
What You'll Learn
After completing this article, you’ll know when to use a File component, how to configure its settings, and how to use it in a module.
About the Configuration Window
General
Setting |
Description |
---|---|
Property ID |
A Property ID is the unique field ID used by Unqork to track and link components in your module. The Property ID is how the software identifies your component. Using Property IDs lets you link components, creating logic-based configurations and API APIs (application programming interfaces) are a set of protocols and definitions developers use to build and integrate application software. APIs act as the connective tissue between products and services. calls. Property IDs must use camel case A naming convention for computer programming. Use camelCase for Property IDs, for example: newUser, lastName, & rdoButton. (stylized as camelCase) without spaces or punctuation. |
Notes |
Select this tab to display the component's Notes area. You can use notes to keep your teammates informed. The Notes editor offers a semi-WYSIWYG (What You See is What You Get) content editor. Built to look like a word processor, this editor lets you create, edit, and format your notes. Notes save when saving the component. |
|
Select this tab to manage your component's display settings. |
|
Select this tab to manage your component's actions settings. |
|
Select this tab to manage your component's data settings. |
|
Select this tab to manage your component's validation settings. |
|
Select this tab to manage your component's advanced settings. |
|
Select this tab to see the RBAC RBAC (Role-Based Access Control) is a method to control system access for authorized users. The role in RBAC refers to the levels of access employees have to a network. (role-based access control) settings of the component. |
|
Assign components one-word labels to help organize, identify, and group the components in your application. Consider an example from the API Specification Snippet: Field Tags are applied to Hidden components in the panelRequest and panelResponse Panels. The Field Tags identify the data type of parameters included in the API APIs (application programming interfaces) are a set of protocols and definitions developers use to build and integrate application software. APIs act as the connective tissue between products and services. request and response. The API Docs Dashboard tool populates with information about each parameter’s data type, identified by the Field Tag. Field Tags act as a type of Property ID A Property ID is the unique field ID used by Unqork to track and link components in your module. group and let you group components for configuration purposes. Field Tags let you target two or more components using a simple logic component. For example, add the Field Tag tagForDecision to multiple components in your module. Open the Inputs table of a Decisions component and reference the tagForDecision Field Tag as the input of the Decisions component. The output of the Decisions component then affects all components with the tagForDecision Field Tag. Save your Field Tags by pressing Enter (Return) or adding a comma after each entry. |
|
Select this tab to open the list of supported keyboard shortcuts you can use in the component settings modal. Keyboard shortcuts include:
Additional keyboard shortcuts:
|
|
Select this tab to access the component documentation in Unqork's In-Product Help. |
Cancel |
Click this button to undo any unsaved configuration changes and return to the canvas. |
Save & Close |
Click this button to save all settings as configured and return to the canvas. |
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. |
Default State Options
Setting |
Description |
---|---|
Disable User Input |
When set to By default, the Disable User Input toggle is set to |
Hide Component |
Shows or hides the component from view. Setting the Hide Component toggle to By default, the Hide Component toggle is set to |
Contextual Help
Setting |
Description |
---|---|
Tooltip |
A short hint that displays when an end-user positions their cursor over the |
Formatting
Setting |
Description |
---|---|
Allow Multiple Files Selection |
When set to By default, this toggle is set to |
Display Thumbnail Images of Icons |
When set to TIP This setting only works when the Parse Files on Upload and Store Data in Database settings are set to By default, this toggle is set to |
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. |
Actions Panel
Triggers
Setting |
Description |
---|---|
Post Upload |
Enter the Property ID of a component you'd like to trigger after the file uploads. |
Data Panel
Setting |
Description |
---|---|
Store Data in Database |
The Store Data in Database setting affects how data persists through your application. When set to
NOTE By default, workflows persist data from all fields in the client-side submission when navigating between screens. However, only values from fields with Store Data in Database enabled store in the server-side submission. Set the toggle to NOTE When using a Plug-In to remote execute a module, ensure data moving between modules is persistent. You can optionally enable Store Data in Database for components in the source module. But any components in the API module whose values are included in an API response must have Store Data in Database enabled. When a component’s data is not persistent, the data isn't included in an API call's response. So, Plug-Ins or external services requesting data from the API module can't receive non-persistent data in the response. To learn more about Store Data in Database in the context of API modules, see the panelResponse Panel section of the API Specification Snippet article in our In-Product Help. TIP Store Data in Database also affects what data is tracked using Unqork’s built-in tracker. When the Enable Tracker and Track Value toggles are set to By default, this setting is |
Validation Panel
Setting |
Description |
---|---|
Required |
When set to By default, the Required toggle is set to |
Required Error Message |
A custom error message that displays below a required field. The error message displays when the end-user tries to save or submit the module without completing the required field. |
Advanced Panel
Additional Data Options
Setting |
Description |
---|---|
Compress .jpg and .png Files |
When set to By default, this toggle is set to |
Parse Excel Files with Multiple Tabs |
When set to By default, this toggle is set to |
Parse Files on Upload |
When set to TIP For this setting to function correctly, the Store Data in Database setting must be set to By default, this toggle is set to |
Additional Styling
Setting |
Description |
---|---|
Custom CSS Class |
Enter a Custom CSS Cascading Style Sheets (CSS) is a style sheet language used for presenting how a HTML or XML document looks to end-users. Class to apply to your component. Use custom CSS to maintain a consistent look and feel if the field or element is part of a template or more than one module. Updated CSS styling applies to all components that reference this custom class name. |
Additional Validation Options
Setting |
Description |
---|---|
Set Maximum Size |
Validation that limits the size of each file an end-user can upload. It might take longer to upload larger files depending on the browser and network connection. NOTE This value must be equal to or less than your use case's file size limit. These thresholds are 18 MB, 100 MB, and 500 MB. |
File Size Helper Text |
A quick tip explaining the file size limits of your File component. |
File Size Error Message |
Custom error message that displays below uploaded files that exceed the maximum size. |
Accepted File Formats
Setting |
Description |
---|---|
Set File Formats to Accept |
Sets the file types accepted by this component. To allow the upload of any file type, simply set the field value to *. To limit file types, list the approved file types adding a comma between each value (for example, .jpg,.png,.gif). |
Adding a File Component
As an example, let's create a basic File component configuration. This component will prompt the end-user to upload a PDF version of their resume.
1. | In the Module Editor, drag and drop a ![]() |
2. | In the Property ID A Property ID is the unique field ID used by Unqork to track and link components in your module. field, enter fileResume. |
3. | In the Label Text Label Text conveys what the input component is and what information it displays. Enter the purpose of the corresponding component or field. field, enter Your Resume. |
4. | From the File component's configuration menu, click ![]() |
5. | Set Required to ![]() |
6. | From the File component's configuration menu, click ![]() |
7. | In the Set File Formats to Accept field, enter .pdf. |
NOTE By entering .pdf in this field, the component only accepts PDF files from the end-user.
8. | Click Save & Close. |
9. | Save your module. |
The File component looks like the following in Express View Express View is how your end-user views you application. Express View also lets you preview your applications to test your configuration and view the styling. After configuring a module, click Preview in the Module Editor to interact with the module in Express View:
Data Structure of a File Component
The File component's data stores in submission data Also known as Record Data. Submission data consists of information saved by Unqork components. View submission data by using the angular command, or in Record Collections. 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 Express View is how your end-user views you application. Express View also lets you preview your applications to test your configuration and view the styling. After configuring a module, click Preview in the Module Editor to interact with the module in Express View:
Here's how the same File component looks in the DevTools Console The DevTools Console helps you securely store, build, test, and deploy your software.:
Resources