Overview

File Schema

s.file()

Generic files. Use s.file for schema, then c.file for content.

NOTE: if you limit the accept to video as the example below, the file will be treated as a video in Val Studio.

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

Example:
const schema = s.file({ accept: "video/*" });
export default c.define("/content/file.val.ts", schema, 
  c.file("/public/val/video.mp4") // NOTE: the actual files must be in the public/val folder
)