Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I trust the file type from $_FILES?

Can I trust the file type from $_FILES when uploading images? Or do I have to check again with exif_imagetype() ?

like image 428
HappyDeveloper Avatar asked Sep 05 '11 13:09

HappyDeveloper


1 Answers

From the documentation:

The mime type of the file, if the browser provided this information. An example would be "image/gif". This mime type is however not checked on the PHP side and therefore don't take its value for granted.

like image 90
Sebastian Wramba Avatar answered Oct 06 '22 00:10

Sebastian Wramba