The MIME type check with accept config is case-sensitive, but it should be case-insensitive according to SO / specs. Source: https://stackoverflow.com/a/12869287/4717408. Here is a scenario where it impacts the behavior. For an Excel file with extension .xlsm, we have the MIME types:
On Chrome Windows: application/vnd.ms-excel.sheet.macroEnabled.12 (upper-case E)
On Chrome Mac: application/vnd.ms-excel.sheet.macroenabled.12 (lower-case e)
This leads to a behavior a bit hard to understand when I develop on Windows (I have copy/pasted the official MIME type which is the first variant, so I'm not aware of the case issue) and I test later on Mac. If I'm not familiar with detailed MIME type specs like being case-sensitive or not, or different platforms providing different cases, it will take some time before I find the source cause.
If the current behavior is a bug, please provide the steps to reproduce.
Do you want to request a feature or report a bug?
What is the current behavior?
The MIME type check with
accept
config is case-sensitive, but it should be case-insensitive according to SO / specs. Source: https://stackoverflow.com/a/12869287/4717408. Here is a scenario where it impacts the behavior. For an Excel file with extension .xlsm, we have the MIME types:This leads to a behavior a bit hard to understand when I develop on Windows (I have copy/pasted the official MIME type which is the first variant, so I'm not aware of the case issue) and I test later on Mac. If I'm not familiar with detailed MIME type specs like being case-sensitive or not, or different platforms providing different cases, it will take some time before I find the source cause.
If the current behavior is a bug, please provide the steps to reproduce.
Sandbox: https://codesandbox.io/s/vigilant-curran-jqxwi
accept: "application/vnd.ms-excel.sheet.macroEnabled.12"
MIME type filterWhat is the expected behavior?
The MIME type should be case-insensitive, so providing any case in the
accept
config should work.Please mention other relevant information such as the browser version, Operating System and react-dropzone version.
Chrome, latest version on Windows and Mac
The current workaround is to provide both cases in the list of accepted MIME types: https://codesandbox.io/s/agitated-night-52c6b
Issue initially created here
Btw, thanks for this great lib!
[Edit] Here is the PR: https://github.com/react-dropzone/attr-accept/pull/51