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.
The best protection against this is with an .htaccess file, as the article explains.
As for the class, depending on your server configuration, it does a lot of checks on the uploaded file to determine its MIME type. It is using Fileinfo PECL extension, UNIX file() command, MIME magic, and getimagesize(), in that order, which should catch malicious files.
Then, you can instruct the class to accept only some MIME types, or refuse some.Reply
As for the class, depending on your server configuration, it does a lot of checks on the uploaded file to determine its MIME type. It is using Fileinfo PECL extension, UNIX file() command, MIME magic, and getimagesize(), in that order, which should catch malicious files.
Then, you can instruct the class to accept only some MIME types, or refuse some.