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
Project information
- Seeking co-maintainer(s)
Maintainers are looking for help reviewing issues. - Module categories: Media, Security
- 1,133 sites report using this module
- Created by dopry on , updated
- Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.
Releases
Improved settings form and status info. Adds simple file upload validator.
Development version: 7.x-1.x-dev updated 1 Jul 2017 at 10:09 UTC