Skip to main content
View as Markdown

Attachment Fields

The media category covers file uploads and the barcode field. single-attachment and multiple-attachments upload files into a storage bucket; barcode stores a scannable value (documented in detail on the Advanced Fields page). All share the base field properties.

Type Stores
single-attachment A single uploaded file.
multiple-attachments Multiple uploaded files.
barcode A barcode value — see Advanced Fields.

single-attachment

One uploaded file (avatar, document, image).

Property Description
bucket Storage bucket name. References a bucket in app.buckets. Uses the implicit default bucket when omitted.
allowedFileTypes Array of allowed MIME types (e.g. ["image/png", "image/jpeg"]). All types allowed when empty.
maxFileSize Maximum file size in bytes (integer ≥ 1). Example: 5242880 for 5 MB.
generateThumbnail Boolean. Generate image thumbnails on upload.
storeMetadata Boolean. Store metadata (image dimensions, video duration).
- id: 1
  name: avatar
  type: single-attachment
  bucket: avatars
  allowedFileTypes: [image/png, image/jpeg, image/gif]
  maxFileSize: 5242880
  generateThumbnail: true
  storeMetadata: true

multiple-attachments

Many uploaded files (a gallery, a document set).

Property Description
bucket Storage bucket name. References a bucket in app.buckets. Uses default when omitted.
maxFiles Maximum number of files allowed (integer ≥ 1).
allowedFileTypes Array of allowed MIME types (e.g. ["application/pdf", "application/msword"]).
maxFileSize Maximum size in bytes per attachment (integer ≥ 1). Example: 10485760 for 10 MB.
generateThumbnails Boolean. Generate image thumbnails on upload. (Note the plural — singular generateThumbnail is for single-attachment.)
storeMetadata Boolean. Store metadata for each attachment.
- id: 2
  name: documents
  type: multiple-attachments
  bucket: documents
  maxFiles: 10
  allowedFileTypes: [application/pdf, application/msword]
  maxFileSize: 10485760
  generateThumbnails: true

The barcode field is the third member of the media category but is documented alongside the other specialized value fields — see Advanced Fields → barcode.