Skip to content

MediaUploadModal: allowedTypes='*' wildcard not handled in upload path, causing all uploads to fail #77149

Description

@dinhtungdu

Description

MediaUploadModal supports '*' as a wildcard in allowedTypes but passes it as-is to uploadMedia(). Inside, validateMimeType has no handling for '*' — it checks file.type.startsWith('*/') which is never true, so every upload fails with "Sorry, this file type is not supported here." instead of being allowed through.

Step-by-step reproduction instructions

  1. Enable the Data Views: new media modal experiment under Gutenberg → Experiments
  2. Install the test plugin: https://github.com/dinhtungdu/verify-wildcard-upload
  3. Add the Wildcard Upload Test block to any post
  4. Open the Inspector → "Wildcard Upload (allowedTypes=[*])" panel
  5. Click "Select / Upload any files" and upload any file type (PNG, PDF, .xyz, etc.)
  6. Observe the error: "filename: Sorry, this file type is not supported here."

Screenshots, screen recording, code snippet

Image

Environment info

  • Gutenberg trunk
  • Affects both @wordpress/media-utils and @wordpress/upload-media packages

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions