src/Titon/Utility/Validate.php
public static function mimeType($input, $mimes) {
        if (static::file($input)) {
            $input = $input['tmp_name'];
        }

        if (!file_exists($input)) {
            return false;
        }

        $file = finfo_open(FILEINFO_MIME_TYPE);
        $type = finfo_file($file, $input);
        finfo_close($file);

        return in_array($type, (array) $mimes);
    }
public static function mimeType($input, $mimes) {
        if (static::file($input)) {
            $input = $input['tmp_name'];
        }

        if (!file_exists($input)) {
            return false;
        }

        $file = finfo_open(FILEINFO_MIME_TYPE);
        $type = finfo_file($file, $input);
        finfo_close($file);

        return in_array($type, (array) $mimes);
    }
public static function mimeType ( $ input , $ mimes ) { if ( static :: file ( $ input ) ) { $ input = $ input [ 'tmp_name' ] ; } if ( ! file_exists ( $ input ) ) { return false ; } $ file = finfo_open ( FILEINFO_MIME_TYPE ) ; $ type = finfo_file ( $ file , $ input ) ; finfo_close ( $ file ) ; return in_array ( $ type , ( array ) $ mimes ) ; }
Validate a files mime type is in the whitelist.

@param string $input
@param string|array $mimes
@return bool
Validate a files mime type is in the whitelist .