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
I found small bug in the documentation.
Property of class was renamed to "dir_auto_create", but in docs:
$handle->auto_create_dir = true;
It is found in doc:
http://www.verot.net/php_class_upload_docs.htm
and in phpdoc of class.