class.upload.php is a powerful and mature PHP class to manage uploaded files, and manipulate images in many ways. The script is available under a GPL license.
more info about the class
See all posts Reply
from:
$this->file_src_mime = $file['type'];
to:
$this->file_src_mime = ($imgInfo = @getimagesize($this->file_src_pathname)) ? $imgInfo["mime"] : $file['type'];
so if imagesize can get the mime type we use this or the mime type of the form in case is not an image.
i would like to know if this is a good solution instead of checking the extension to determine the type of file.