Restrict file types accepted by the file widget
- Dominant language
- JavaScript
- Stars
- 19.4k
- Forks
- 3.1k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 9
Description
It would be useful to restrict what files are selectable in the `file` widget.
**Is your feature request related to a problem? Please describe.**
I found [this related discussion](https://github.com/decaporg/decap-cms/discussions/6505#discussioncomment-3093794) but the `pattern` method does not appear to work (any more?).
**Describe the solution you'd like**
A new widget option is necessary to set the one more more values matching the `accept` attribute of the HTML file input element, like `.jpg`, `video/*`, or `application/vnd.openxmlformats-officedocument.wordprocessingml.document`
Contributor guide
Research direction
Start by locating the `file` widget implementation and checking how widget options are translated to the HTML file input. Use the requested `accept` values, including extensions, MIME types, and wildcards, as the behavioral target. Done means the widget restricts selectable files according to the configured option.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100