I am doing a script file upload that only jpg permits.
the script that I use to verify
$size = getimagesize($filename);
$size['mime'];
This works in most cases. However, if I have a “gif” file and I renamed the extension to “jpg”, it tricks the system, since the mime type for this file is displayed as jpg.
How can I prevent this?
So allowed jpg and png gif is prohibited
source
share