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.
For the JPEG, your file seems not to have been uploaded at all, which is why the variables are empty.
You must have $foo->uploaded equals to false. The error code (file_src_error : 2) indicates that the file is too big because there is a limit set in your HTML input file field. In fact, you probably have a plain english error message in $foo->error which is likely saying "File upload error (the uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the html form)".
Is is not the case? Doesn't your code work with a small JPEG file?Reply
You must have $foo->uploaded equals to false. The error code (file_src_error : 2) indicates that the file is too big because there is a limit set in your HTML input file field. In fact, you probably have a plain english error message in $foo->error which is likely saying "File upload error (the uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the html form)".
Is is not the case? Doesn't your code work with a small JPEG file?