File Field
type: "file"
A file upload for images, videos and other files. The uploaded files are stored by MoBro and served to the dashboard.
Additional Properties
| Property | Type | Description |
|---|---|---|
| multiple | boolean | Whether users can upload multiple files. |
| accept | string | The file types users can upload, as for the accept attribute of a file input, e.g. image/*. |
| defaultValue | ValueFile[] | The default files. |
Example
mobro-widget-config.json
{
"config": [
{
"name": "background_image",
"label": "Background image",
"type": "file",
"accept": "image/*"
}
]
}
Usage
To read the value of this field in a widget, use:
useFileFieldfor a single file.useFilesFieldifmultipleistrue.