I have laravel project that let user upload images and I can validate (jpeg/png) without problem. the problem occur when users upload JFIF-image (which consider to be images/jpeg mime types) but the laravel intervention package show message "Encoding format (jfif) is not supported." so, how to detect jfif during validation to prevent this. I tried:
$request->file('image')->extension() //return jpeg
You should be able to get the extension using
Note that this function makes use of the
pathinfo()
function and so is based on the file name as per the comment on the source code