Overview
File Schema
s.file()
Generic files. Use s.file for the schema. The content is a plain object with a path and the mimeType read off the file.
NOTE: if you limit the accept to video as the example below, the file will be treated as a video in Val Studio.
Passing a file collection module instead of options - s.file(collectionVal) - turns the field into a picker for that collection. The value is then only the path: the mimeType is stored once, in the collection, and repeating it on the field is a validation error.
Options:
accept: string
The accept value is a comma-separated list of one or more image types, or unique file type specifiers, describing which file types to allow.
s.file({ accept: "video/*" })
Methods:
.validate: method
Custom validation function
.remote: method
Enable remote files