MimeDetect
Categories
Component ID
Component name
Component type
Maintenance status
Development status
Component security advisory coverage
Downloads
Component created
Component changed
Component body
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, this module is part of the core, so the integration with non-core (third-party) modules like MimeDetect 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.
Modules using it
- FileField module (D6 only), detects and use MimeDetect if present
If you know any other module that makes use of MimeDetect, please report me.
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
Note on security coverage
This module is on the way to get security coverage. As it may take some time, project maintainers offer security coverage in the meantime, just contact me. Please, remember not to report security issues in the project issue queue.
