silverstripe / mimevalidator
Checks uploaded file content roughly matches a known MIME type for the file extension.
Installs: 1 457 015
Dependents: 11
Suggesters: 2
Security: 0
Stars: 10
Watchers: 15
Forks: 14
Open Issues: 5
Type:silverstripe-vendormodule
Requires
- php: ^8.3
- ext-fileinfo: *
- silverstripe/framework: ^6
Requires (Dev)
- monolog/monolog: ^3.2.0
- phpstan/extension-installer: ^1.3
- phpunit/phpunit: ^11.3
- silverstripe/standards: ^1
- squizlabs/php_codesniffer: ^3.7
- 4.x-dev
- 4.0.x-dev
- 4.0.0-alpha1
- 3.x-dev
- 3.1.x-dev
- 3.1.0
- 3.1.0-rc1
- 3.1.0-beta1
- 3.0.x-dev
- 3.0.1
- 3.0.0
- 3.0.0-rc1
- 3.0.0-beta1
- 3.0.0-alpha1
- 2.x-dev
- 2.5.x-dev
- 2.5.1
- 2.5.0
- 2.5.0-rc1
- 2.5.0-beta1
- 2.4.x-dev
- 2.4.0
- 2.4.0-rc1
- 2.4.0-beta1
- 2.3.x-dev
- 2.3.0
- 2.3.0-rc1
- 2.3.0-beta1
- 2.2.x-dev
- 2.2.0
- 2.2.0-rc1
- 2.2.0-beta1
- 2.2.0-alpha1
- 2.1.x-dev
- 2.1.1
- 2.1.0
- 2.1.0-rc1
- 2.1.0-beta1
- 2.0.x-dev
- 2.0.0
- 2.0.0-beta1
- 1.0.x-dev
- 1.0.12
- 1.0.11
- 1.0.10
- 1.0.9
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
This package is auto-updated.
Last update: 2024-12-04 00:28:33 UTC
README
Installation
composer require silverstripe/mimevalidator
Introduction
Checks uploaded file content roughly matches a known MIME type for the file extension.
It can be used with FileField
or any subclasses like UploadField
.
For example, it will fail validation if someone renames a .exe
file to .jpg
and attempts to upload the file.
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 silverstripe/recipe-core
.
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.
Configuration
Read Allowed file types on the Silverstripe CMS documentation for details on configuring MIME type validation.