Oihana PHP

mimes.php

Table of Contents

Functions

mimes()  : string
Generates the 'mimes:extension_a,extension_b,...' rule expression.

Functions

mimes()

Generates the 'mimes:extension_a,extension_b,...' rule expression.

mimes(string ...$values) : string

The $_FILES item under validation must have a MIME type corresponding to one of the listed extensions.

This works on file extension and not client sent headers or embedded file type.

If you require strict mime type validation you are recommended to implement a custom MimeTypeGuesser that uses a full mime-type lookup library and replace the built-in mime rule.

Parameters
$values : string

The allowed MIME file extensions (e.g. jpg, png).

Return values
string

The compiled mimes:<extensions> rule expression.

On this page

Search results