cardinal

Files

Attachments live in S3-compatible storage and follow the Record's permissions.

Files are stored in an S3-compatible bucket, never on a node's disk. Each upload creates a File Record that points at the stored bytes.

Attaching

  • Choose a file in an Attach or Attach Image field.
  • Drop or paste an image into a Text Editor field.
  • Use Attach a file under Attachments in the form sidebar, or drop files there.

On a new Record the upload attaches when you save. A RecType can cap its attachments with max_attachments.

The File form previews images, video, audio and PDFs, and has Open and Download buttons. SVG files always download, since they can carry scripts.

Who can see a file

FileWho can download it
Private (the default)Users who can read the Record it is attached to
Private, not attachedIts owner only
PublicAnyone with its link, including guests

Attaching a file to a Record needs write on that Record.

Limits

System Settings' max_file_size caps uploads at 25 MB by default. The allowed types are:

txt csv json md xml svg html htm pdf png jpg jpeg gif webp zip
docx xlsx pptx odt ods odp doc xls ppt mp4 mov

The bytes must match the extension. A .pdf that is not a PDF is refused.

Downloads

GET /api/file/<name> answers with a redirect to a signed URL that lives 300 seconds. Add ?download=1 to save it instead of opening it.

Storage and cleanup

Identical bytes uploaded twice in one site share one object. Deleting a Record deletes its File rows. A daily job removes objects that no File row has named for 24 hours.

Set the bucket with the CARDINAL_S3_* variables. See Deploy.

On this page