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.
This version fixes a few bugs, but most notable rewrites the entire MIME type detection. The class is now using Fileinfo PECL extension, UNIX file() command, MIME magic, and getimagesize(), in that order, to detect the MIME type. The MIME type as sent by the browser (or guessed from the file extension in case of Flash) will be used only if all the previous methods fail.
Please use it and test it. Some of the MIME detection routines depend on the OS, so I couldn't test everything. If you use a Flash uploader, can you also give a go to 0.26RC2Reply
You can get it here.
This version fixes a few bugs, but most notable rewrites the entire MIME type detection. The class is now using Fileinfo PECL extension, UNIX file() command, MIME magic, and getimagesize(), in that order, to detect the MIME type. The MIME type as sent by the browser (or guessed from the file extension in case of Flash) will be used only if all the previous methods fail.
Please use it and test it. Some of the MIME detection routines depend on the OS, so I couldn't test everything. If you use a Flash uploader, can you also give a go to 0.26RC2