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
source is an uploaded file
- source variables
file_src_name :
file_src_name_body :
file_src_name_ext :
file_src_pathname :
file_src_mime :
file_src_size : (max= 2097152)
file_src_error : 2
gif
source is an uploaded file
- upload OK
- file name OK
- source variables
file_src_name : apache_pb2.gif
file_src_name_body : apache_pb2
file_src_name_ext : gif
file_src_pathname : /tmp/phpOFiZSH
file_src_mime : image/gif
file_src_size : 2414 (max= 2097152)
file_src_error : 0
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?