Skip to content

Form engine: add a file-upload answer type (photo uploads in forms) #2109

Description

@maebeale

🤖 From Claude: Filed while spiking the post-event survey feature.

Context

The AWBW post-event/post-training evaluation (currently an external form) includes a "upload a photo of one of your creations" question. When bringing that survey in-house as a Form, there is no way to represent a file upload: FormField#answer_type only supports one-line text, paragraph, single-select radio, single-select dropdown, multi-select checkbox, section header, and informational-only (app/models/form_field.rb:114-122). FormAnswer stores a text submitted_answer only — no attachment.

For the spike the photo question is dropped (see the post-event survey PR). This issue tracks adding real support.

What's needed

  • A new answer_type (e.g. file_upload) on FormField.
  • Active Storage-backed attachment on FormAnswer (or a dedicated answer-attachment model), with content-type/size validation.
  • Rendering in the public form (events/public_registrations/_form_field and the new survey callout page), the form builder editor, and read-only submission views.
  • Handling in the submission service, FormAnswerValidator, and submission-notification emails.
  • Consider image-sharing consent (the source form pairs the photo with a "how may we share this" consent) — see the post-event survey's content-sharing consent field.

Not doing now

Just tracking. No work required until the form engine needs uploads.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions