wanna check my uploaded images for right mime type:
$user->image = CUploadedFile::getInstance($user, 'image');
in my Validation i check mime type with:
print_r(CFileHelper::getMimeType($this->image));
well, i uploaded a pdf and mime type was application/pdf.
i renamed the pdf to test.jpg, and mime type is now image/jpg which is a problem. i just wanna accept images.
i use the newest versions:
yii-1.1.12.b600af; XAMPP Windows 1.8.0; PHP Version 5.4.4
Because Yii by default defines mime type according to extension.
You can see the code
As you see
$checkExtension=true.You can try like that:
So It will not decide by extension.
For validation purpose:
Alway use existing things, do not try to re-create.