Cfilevalidator

In 1.1 you could verify the mimetype of a file http://www.yiiframework.com/doc/api/1.1/CFileValidator.

What’s the process in 2.0. I couldn’t find out?

Thanks

https://github.com/yiisoft/yii2/blob/master/framework/yii/validators/FileValidator.php#L31

That seems to be extension name though? Rather than actual mimetype?

It looks like they have mimetypes in the ImageValidator. You can use that for images, but you may need to write your own validator for other types of files.

I think that to get mime-type is not trivial task.

FileHelper::getMimeType()?

It exists in Yii 1, as I use it to validate a .docx or .doc mime type. So I would think that it would be available in Yii 2.0