Is there a good method for making sure that an uploaded file is an image in PHP?
How would I do that?
Brian
2010-02-11 06:52:26
Use this -> http://www.php.net/manual/en/function.finfo-file.php
AntonioCS
2010-02-11 09:20:09
A:
One method that goes beyond asking it if it an image using MIME, FileInfo, etc. is to try and do something with it as an image -- load up with GD or ImageMagik and use that to write a new copy to the desired location.
Devin Ceartas
2010-02-11 05:16:22
A:
Pass the received file to the getimagesize() function. If the file is an image (of supported type) you'll get back an array, with the image type stored as third member of the array. If the file is not an image result will be false.
djn
2010-02-11 23:58:13