Files Schema
s.files()
A collection of files that is the whole module - the same idea as s.images(), for any file type rather than images. Where s.file() defines a single field, s.files() defines a module that holds many files at once, keyed by their file path.
The content is a record: each key is the path of a file in the collection's directory, and each value is the mimeType Val read off that file. Entries appear when a file is uploaded through Val Studio, the CLI or the VS Code extension - you do not write them by hand.
Fields elsewhere pick from a collection with s.file(collectionModule), the same way s.image(galleryModule) picks from an image gallery.
Like image galleries, file collections are listed under Media in Val Studio rather than in the Explorer file tree.
Options:
Required. Which file types the collection accepts. A comma-separated list of one or more MIME types, or unique file type specifiers.
Required. Where the files in this collection are stored. Must start with /public. Two collections may not claim the same directory.
Methods:
Store the files of this collection on Val's remote server instead of in your git repository. See the remote files guide.