dotCMS / dotCMS/core

[FEATURE] Add accept field variable support to File fields for MIME type filtering

Open
#34,382 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

stale
Dominant language
Java
Stars
970
Forks
486
Avg merge
3d 33m
Merged PRs (30d)
170

Description

Problem

Currently, File fields do not respect the accept field variable for MIME type filtering, even though:
The UI allows users to set the accept field variable on File fields
Binary fields already support this feature
Image fields have built-in MIME type filtering (image/*)
This creates an inconsistent user experience and prevents content editors from restricting file types in File fields (e.g., limiting to video/mp4 for video uploads).

Goal
  • Add accept field variable support to File fields to enable MIME type filtering, providing:
  • Feature parity between Binary and File field types
  • Consistent user experience across field types
  • Better content governance by allowing administrators to restrict file types per field
  • Alignment with user expectations - if the UI allows setting the variable, it should work
  • Users will be able to restrict File fields to specific MIME types (e.g., video/mp4, application/pdf, video/*) just like Binary fields, while maintaining the ability to select files from the dotCMS server (which Binary fields don't support).
Target Personas
  • Developer teams
  • Content teams
  • DevOps teams
  • System administrators (dotCMS)
Demo Expectations

Setting up a File field with MIME type restriction

Acceptance Criteria
  • Fields should process the accept field variable similar to Binary fields
  • File selection dialogs and upload components should filter files based on the accept MIME types
  • This should work for both file uploads and "select existing file" browser dialogs
User Stories

No response

Links

https://helpdesk.dotcms.com/a/tickets/35126

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing how Binary fields process the accept field variable, then trace the File field upload and existing-file selection dialogs described in the acceptance criteria. Done means both upload and server-file selection filter files by the configured MIME types while preserving existing File field behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.