A file is a special kind of object that includes an implicit asset field, which is a reference to an file asset document. This is useful for storing any non-image file (pdfmpegdocx etc).


  • optionsobject - Extra type options. See below.
  • fields: array - An array of optional fields to add to the file record. The fields added here follows the same pattern as fields defined on objects. This is useful for allowing users to add custom metadata to the file record itself (see example below).


  • storeOriginalFileName: boolean (default true) - This will store the original filename in the asset document. Please be aware that the name of uploaded files could reveal potentially sensitive information (e.g. top_secret_planned_featureX.pdf).

Example schema

  title: 'Manuscript',
  name: 'manuscript',
  type: 'file',
  fields: [
      name: 'description',
      type: 'string',
      title: 'Description'
      name: 'author',
      type: 'reference',
      title: 'Author',
      to: {type: 'person'}

Example output data

  "_type": "file",
  "asset": {
    "_type": "reference",
    "_ref": "file-5igDD9UuXffIucwZpyVthr0c"
  "description": "First draft",
  "author": {
    "_type": "reference",
    "_ref": "1osKfX-49GLPg-2EeuOe-3ufEFE"

Previous: ImageNext: URL