Skip to main content

File Picker

File Picker component allows the user to drag and drop files or upload files by browsing the file system and selecting one or more files in a directory.

info

File types must be a valid MIME type according to input element specification or a valid file extension.

To accept any/all file type(s), set Accept file types to an empty value.

tip

MIME type determination is not reliable across platforms. CSV files, for example, are reported as text/plain under macOS but as application/vnd.ms-excel under Windows.

Properties

Property
Description
Expected Value
LabelText to display as the label for the field.String
PlaceholderA hint displayed to guide the user.String
Use drop zoneCreates a drag & drop zone. Files can be dragged and dropped to the "drag & drop" zone.Enable/disable the toggle button or dynamically configure the value by clicking on fx and entering a logical expression.
Use file pickerOn clicking it invokes the default OS file prompt.Enable/disable the toggle button or dynamically configure the value by clicking on fx and entering a logical expression.
Allow picking multiple filesAllows drag and drop (or selection from the file dialog) of multiple files.Enable/disable the toggle button or dynamically configure the value by clicking on fx and entering a logical expression.
Enable parsingEnable parsing to automatically convert uploaded CSV or JSON files into usable data within your app.Enable/disable the toggle button or dynamically configure the value by clicking on fx and entering a logical expression.

Events

Event
Description
On file selectedTriggers whenever one or more files are selected by the selector dialogue box.
On file loadedTriggers whenever a file is loaded in the browser.
On file deselectedTriggers whenever one or more files are removed from the picker.
info

Check Action Reference docs to get detailed information about all the Actions.

Component Specific Actions (CSA)

The following actions of the component can be controlled using the component-specific actions (CSA), you can trigger it using an event or use a RunJS query.

Actions
Description
How To Access
clearFiles( )Clears the selected files from the file picker component.components.filepicker1.clearFiles()
setFileName( )Sets the file name for the uploaded file.components.filepicker1.setFileName()
setVisibility( )Sets the visibility of the component.components.filepicker1.setVisibility()
setLoading( )Sets the loading state of the component.components.filepicker1.setLoading()
setDisable( )Disables the component.components.filepicker1.setDisable()

Exposed Variables

Variables
Description
How To Access
fileHolds information of file loaded in the file picker.{{components.filepicker1.file}}
isParsingIndicates if the parsing is enabled{{components.filepicker1.isParsing}}
isValidIndicates if the uploaded file is valid.{{components.filepicker1.isValid}}
fileSizeStores the file size.{{components.filepicker1.fileSize}}
isMandatoryIndicates if the component is mandatory.{{components.filepicker1.isMandatory}}
isLoadingIndicates if the component is loading.{{components.filepicker1.isLoading}}
isVisibleIndicates if the component is visible.{{components.filepicker1.isVisible}}
isDisabledIndicates if the component is disabled.{{components.filepicker1.isDisabled}}
filesHolds an array of file objects loaded in the file picker.{{components.filepicker1.files}}

Validation

Validation Option
Description
Expected Value
Make this field mandatoryDisplays a 'This field is mandatory. Please select a file.' message if no file is selected.Enable/disable the toggle button or dynamically configure the value by clicking on fx and entering a logical expression.
File typeSelect the acceptable file type.Choose from dropdown or dynamically configure the value by clicking on fx and entering a logical expression.
Min size limitSets the minimum file size that can be uploaded.File size in Bytes.
Max size limitSets the maximum file size that can be uploaded.File size in Bytes.
Min file countSets the minimum number of files that needs to be uploaded.Numeric
Max file countSets the maximum number of files that can be uploaded.Numeric

Additional Actions

Action
Description
Configuration Options
Loading stateEnables a loading spinner, often used with isLoading to indicate progress. Toggle or set dynamically.Enable/disable the toggle button or dynamically configure the value by clicking on fx and entering a logical expression.
VisibilityControls component visibility. Toggle or set dynamically.Enable/disable the toggle button or dynamically configure the value by clicking on fx and entering a logical expression.
DisableEnables or disables the component. Toggle or set dynamically.Enable/disable the toggle button or dynamically configure the value by clicking on fx and entering a logical expression.
TooltipProvides additional information on hover. Set a string value for display.String

Devices

Property
Description
Expected Value
Show on desktopMakes the component visible in desktop view.You can set it with the toggle button or dynamically configure the value by clicking on fx and entering a logical expression.
Show on mobileMakes the component visible in mobile view.You can set it with the toggle button or dynamically configure the value by clicking on fx and entering a logical expression.

Styles

File Drop Area

Property
Description
Configuration Options
TitleSets the title text color.Select a theme or choose from color picker.
Active colorSets the active state color.Select a theme or choose from color picker.
Error colorSets the color for error text.Select a theme or choose from color picker.

Container

Property
Description
Configuration Options
BackgroundSets the component background color.Select a theme or choose from color picker.
BorderSets the border color of the component.Select a theme or choose from color picker.
Border radiusModifies the border radius of the component.Enter a number or click on fx and enter a code that programmatically returns a numeric value.
Box shadowSets the box shadow properties of the component.Select the box shadow color and adjust the related properties or programmatically set it using fx.
PaddingAllows you to maintain a standard padding.Numeric Value.
info

Any property having fx button next to its field can be programmatically configured.