You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The $file which is analysed in above function is the temporary file with .tmp extension on Windows and no extension (/tmp/xxxxx) on Linux. We cannot get "getMimeTypeByExtension" from it.
Adding 'checkExtensionByMimeType' => false, to validation rules solved the problem for me. Is that expected behaviour?
Additional info
Q
A
Yii version
2.0.45
PHP version
8.1.3
Operating system
Windows/Linux
The text was updated successfully, but these errors were encountered:
What steps will reproduce the problem?
What is the expected result?
Allow *.jpg and *.png
What do you get instead?
All extensions including jpg and png are considered invalid.
The problem is here:
yii2/framework/helpers/BaseFileHelper.php
Lines 165 to 167 in 1271bc4
The $file which is analysed in above function is the temporary file with .tmp extension on Windows and no extension (/tmp/xxxxx) on Linux. We cannot get "getMimeTypeByExtension" from it.
Adding
'checkExtensionByMimeType' => false,
to validation rules solved the problem for me. Is that expected behaviour?Additional info
The text was updated successfully, but these errors were encountered: