MimeDetect provides a complete system for detecting the actual content of files in your Drupal site.
By default, Drupal provides a "guessing" system based on the filename extension. This is very weak and your site could store files with real content different from the one indicated by its extension.
MimeDetect provides detection on two levels:
- Programmatic detection (D8 only)
A way of file content detection by coding specific plugins. For example, CSV files are often detected as "text/plain". MimeDetect comes with a plugin that examines the actual content of files with .csv extension and determines whether or not they are in CSV format ("text/csv"). You can also develop your own plugin to detect unusual or undetectable content types by other tools. - MIME 'magic' method
the traditional MIME detection method, provided by the PHP fileinfo extension and / or the UNIX 'file' command.
File upload validation
Drupal 6 file field module has integration with MimeDetect. Since Drupal 7, file field is in core, so the integration with third-party modules was lost.
This functionality is now provided by the "MimeDetect file upload validator" submodule present in D7 & D8 versions of the module, included for backward compatibility and to provide basic functionality.
How to collaborate
- open an issue asking for any feature you are missing
- review some of the pending patches
- follow some issue of a requested feature, most followed issues will have higher priority
- help in translating this project
Supporting organizations:
Project information
Seeking co-maintainer(s)
Maintainers are looking for help reviewing issues.- Project categories: Media, Security
958 sites report using this module
- Created by dopry on , updated
Stable releases for this project are covered by the security advisory policy.
There are currently no supported stable releases.

