File Dropzone
A drag-and-drop area to select and upload files. It supports file type restrictions, multiple file or directory selection, and can perform validation of field requirement, minimum or maximum size, and custom rules.
File Dropzone can attempt to parse text-based files, such as JSON, CSV, and Excel spreadsheets. The maximum size for uploaded files is 40MB.
Properties
Available properties for File Dropzone with supported data types or values. You can write JavaScript almost anywhere in Retool to manipulate or read information about components.
The selected files as Retool file objects. For legacy components, the selected files are base64 encoded strings.
A list of file extensions or file-type specifiers to accept.
When true, new file selections will be appended to the current file list instead of replacing it.
Whether user input, interaction, or selection is disabled.
New components no longer have this property. A list of metadata from the selected files. Includes name
, type
, size
, and lastModified
.
The key used by a Form component to assign default values to input fields using form.initialData
, and to construct the form.data
property.
Whether the component is visible.
Whether to hide the validation message if the invalid
is true
.
The icon to display before the primary content.
Whether the current value has failed any validation rules.
When true, the file will be accessible through URL from outside of Retool. When false, the file will only be accessible within Retool.
The text to display as a label for the input field.
The horizontal alignment of the label.
The additional text to display with the label.
The position of the label relative to the input field.
The label width, in the unit specified in labelWidthUnit
.
The specified units for labelWidth
.
Whether the label can wrap to multiple lines.
Whether to display a loading indicator.
Whether the component takes up space on the canvas if hidden
is true
.
The amount of margin to render outside of the component.
The maximum number of items to allow.
The maximum file size to allow, with optional size unit. Defaults to bytes if no unit specified.
The minimum number of items to allow.
The minimum file size to allow, with optional size unit. Defaults to bytes if no unit specified.
Whether to parse the selected files. Parsing is supported for JSON, CSV, TSV, Excel, and text files.
The data parsed from the selected files if parseFiles
is true
.
Whether selected files are currently being read or parsed.
The text to display in the input field when empty.
Whether the input is required for validation.
Whether to allow selection of single or multiple files, or a directory of files.
When true, the file will be overwritten if a file with the same name already exists. If false and a file with the same name already exists, the file will be renamed to include a number at the end to avoid collissions E.g: example (1).txt
Whether the component remains visible in the editor if hidden
is true
.
The text to display in a tooltip on hover or focus.
When true, files will be uploaded to Retool Storage.
The validation message to display if the input is invalid.
Events
Events are triggered by user interactions with File Dropzone. Use event handling to trigger queries or other actions in response to events.
A user changes the current value.
An uploaded file is parsed.
Methods
Methods for interacting with File Dropzone. You can write JavaScript almost anywhere in Retool and use methods to manipulate data or components.
Clear the current value.
Scrolls the canvas or parent container so that the selected component appears in the visible area.
Validates the value of the input field.
Clear the validation message from the input field.
Set the hidden
value to toggle whether the component is visible. Defaults to true
without a parameter.
Set the disabled
value to toggle whether the input field is disabled. Defaults to true
without a parameter.
Reset value
to the default value.
Set focus on the input field.
Removes focus on the input field.