silverstripe/mimevalidator

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

Installs: 773 580

Dependents: 10

Suggesters: 1

Security: 0

Stars: 10

Watchers: 15

Forks: 14

Open Issues: 5

Type:silverstripe-vendormodule

3.0.0-beta1 2023-01-22 21:28 UTC

README

CI Silverstripe supported module

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.

Requirements

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 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.