Skip to content

[6.x] Forms 2: Various file upload improvements#15006

Draft
duncanmcclean wants to merge 2 commits into
forms-2from
forms-2-file-uploads
Draft

[6.x] Forms 2: Various file upload improvements#15006
duncanmcclean wants to merge 2 commits into
forms-2from
forms-2-file-uploads

Conversation

@duncanmcclean

@duncanmcclean duncanmcclean commented Jul 14, 2026

Copy link
Copy Markdown
Member

This pull request makes various improvements to how File Uploads are handled in Forms.

Upload fieldtype

This PR adds a new Upload fieldtype, designed to better facilitate file uploads on forms.

Previously, the Upload form fieldtype resolved to either the assets/files fieldtypes, depending on whether the uploaded file should be stored or not.

This worked great — until we started building automagic form pages in Forms Pro, which reuses fieldtype Vue components. The assets and files fieldtypes had different UIs, which was a little confusing, but they also hit /cp URLs which require authentication (something a visitor filling out a form obviously doesn't have).

FormUploadFieldtype.vue has two states:

  • Editable: a drag & drop UI styled after the files fieldtype. Instead of uploading files the moment they're added, they're uploaded when the page is submitted. This is the state used on the Automagic Form page.
  • Read-only: used when viewing a submission. File uploads can't be changed, so the upload UI is hidden. Users can click to download assets.

Form::convertFieldsFromBlueprint() already migrates assets/files fields to the Upload form fieldtype when converting a traditional blueprint to Forms 2. However, we still need to support bare assets/files fields directly, since fields brought in via a fieldset import use their real, underlying fieldtype, rather than going through a "form fieldtype".

@duncanmcclean duncanmcclean changed the title [6.x] Forms 2: Add Upload fieldtype to handle form file uploads [6.x] Forms 2: File Upload Improvements Jul 14, 2026
@duncanmcclean duncanmcclean changed the title [6.x] Forms 2: File Upload Improvements [6.x] Forms 2: Various file upload improvements Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant