MIME upload validator
Checks uploaded file content roughly matches a known MIME type for the file extension.
It can be used with
FileField or any subclasses like
For example, it will fail validation if someone renames a
.exe file to
and attempts to upload the file.
- SilverStripe 4.0+
- fileinfo PHP extension
Note: For a SilverStripe 3.x compatible version, please use the 1.x release line.
Installation via Composer
Install with composer by running
composer require silverstripe/mimevalidator in the root of your SilverStripe project.
Silverstripe CMS Recipe 4.6 and above include this module via
Therefore, it is unnecessary to directly install this module if your project has been upgraded to,
or was created with CMS Recipe 4.6.0 or later.
Read Allowed file types on the Silverstripe CMS documentation for details on configuring MIME type validation.