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.
There isn't really a way to check whether the file is corrupted or not. It could be possible, but would be a quite large endeavor, and in fact will probably amount to load it with GD to check it, which is actually what seems to be causing problems anyway.
Yes, please, send me the corrupted file, I'll have a look at it.Reply
Yes, please, send me the corrupted file, I'll have a look at it.