files collection with file: true:
Config options
Admin options
Upload fields support the standard field admin options, plus these options:Custom file collection
To use a slug other thanfiles, mark one collection with file: true. FrogBot enables its required upload behavior while preserving your fields and settings:
file: true. FrogBot merges its required upload configuration into that collection. Without a marked collection, FrogBot adds none, and an Upload field whose relationTo names a missing collection stops startup.
Do not use upload: true to select the FrogBot file collection. If the marked collection also sets upload: false, configuration fails.
Filtering upload options
UsefilterOptions to limit files in the selector and validate submitted relationships. It accepts a query constraint, or a callback that returns a constraint, true to allow every record, or false to allow none.
The callback receives:
For example, limit the default file collection to images:
Bidirectional relationships
An Upload field stores the connection on the record containing it. The file record does not automatically list every record that uses it. Add a Join field to the file collection when editors or API consumers need to traverse the relationship in both directions.Polymorphic uploads
The underlying field shape accepts an array inrelationTo, but every target must be an active file collection. FrogBot has exactly one file collection, so polymorphic Upload fields are not supported. Use separate Upload fields when records need distinct asset roles.
Use hasMany to select multiple records from the active file collection:
files with the slug of the collection marked file: true.
Custom components
Override the field throughadmin.components. A custom component can wrap FrogBot’s default upload control: