silverstripe/mimevalidator

Checks uploaded file content roughly matches a known MIME type for the file extension.

4.0.0 2025-04-02 16:27 UTC

Requires

Suggests

None

Provides

None

Conflicts

None

Replaces

None

BSD-3-Clause 723831a77e180ed570309e3a1b084658bbcdef48

  • Sean Harvey <sean.woop@silverstripe.com>

validatoruploadmimefileinfosilverstripecwp


README

👁 CI
👁 Silverstripe supported module

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.