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.
After more troubleshooting I noticed whenever I add a $handle->allowed, I get the same error (no matter what the mime-type is). I only seem to be able to upload images without having to use $handle->allowed.Reply
As for allowed, use it as following, to test: