Andrew13\Cabinet\CabinetUpload::verifyUploadType PHP Method

verifyUploadType() public method

Checks the upload vs the upload types in the config.
public verifyUploadType ( Symfony\Component\HttpFoundation\File\UploadedFile $file )
$file Symfony\Component\HttpFoundation\File\UploadedFile
    public function verifyUploadType(UploadedFile $file)
    {
        if (!in_array($file->getMimeType(), static::$app['config']->get('cabinet::upload_file_types')) || !in_array(strtolower($file->getClientOriginalExtension()), static::$app['config']->get('cabinet::upload_file_extensions'))) {
            throw new FileException('Invalid upload type.');
        }
    }