Skip to content

[Bug] text/markdown custom file validation not working #1037

@YaroBear

Description

@YaroBear

Is there an existing issue for this?

  • I have searched the existing issues

Have you updated FilePond and its plugins?

  • I have updated FilePond and its plugins

Describe the bug

I want to restrict file uploads to only Markdown (.md) files. However, since most browsers do not reliably detect the MIME type for .md files, I understand that a custom fileValidateTypeDetectType function is required. The custom validation function provided does not work as expected.

Reproduction

  • Set the acceptedFileTypes property to ".md" which limits the file picker to only select files with the .md extension
  • Resolve "text/markdown" or "text/plain" for the fileValidateTypeDetectType
  • Get "File is of invalid type" error message

See this codesandbox: https://codesandbox.io/p/devbox/friendly-butterfly-pxqm92?workspaceId=ws_PrPLhqSkCsZkRf6v6g8FR1

Environment

- Device: Macbook Pro M3
- OS: MacOS 15.3.1
- Browser: Firefox Developer Edition, Edge, and Safari

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