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.
Thanks for the response. Yes, appreciate the value is small, the idea being that it will always fail, as I wanted to test catching the error in my app.
The issue i have is that once i add the $handle->file_max_size code, it fails. The log is as follows:
system information - class version : 0.27 - GD version : 2.0.34 - supported image types : png jpg gif bmp - open_basedir : no restriction - language : en_GB source is an uploaded file - upload OK - file name OK - MIME type detected as image/jpeg by PHP getimagesize() function - source variables file_src_name : DSCF0073.jpg file_src_name_body : DSCF0073 file_src_name_ext : jpg file_src_pathname : /tmp/phpL01Kyz file_src_mime : image/jpeg file_src_size : 69542 (max= 10485760) file_src_error : 0 - source file is an image image_src_x : 500 image_src_y : 375 image_src_pixels : 187500 image_src_type : jpg image_src_bits : 8
My own logging shows:
FATAL: exception with message 'unlink(67e103b0761e60683e83c559be18d40c.) [function.unlink]: No such file or directory' in /home/boardh/web/index.php:80 Stack trace: #0 [internal function]: ErrorHandler(2, 'unlink(67e103b0...', '/home/boardh/ap...', 3036, Array) #1 /home/boardh/application/lib/upload.class.php(3036): unlink('67e103b0761e606...') #2 /home/boardh/application/controllers/photocontroller.php(92): upload->process('/home/boardh/we...') #3 [internal function]: photoController->upload() #4 /home/boardh/application/models/frontcontroller.php(78): ReflectionMethod->invoke(Object(photoController)) #5 /home/boardh/web/index.php(87): FrontController->route() #6 {main}
So it looks like im getting a "No such file or directory" caused by line 3036 of the class -
I am not too sure what can be the cause. The line 3036 is part of the code which checks that the destination directory is writable. It attemps to create a temp file (which it seems to have done with success, and then deletes it on line 3036).
Thanks for the response. Yes, appreciate the value is small, the idea being that it will always fail, as I wanted to test catching the error in my app.
The issue i have is that once i add the $handle->file_max_size code, it fails. The log is as follows:
system information
- class version : 0.27
- GD version : 2.0.34
- supported image types : png jpg gif bmp
- open_basedir : no restriction
- language : en_GB
source is an uploaded file
- upload OK
- file name OK
- MIME type detected as image/jpeg by PHP getimagesize() function
- source variables
file_src_name : DSCF0073.jpg
file_src_name_body : DSCF0073
file_src_name_ext : jpg
file_src_pathname : /tmp/phpL01Kyz
file_src_mime : image/jpeg
file_src_size : 69542 (max= 10485760)
file_src_error : 0
- source file is an image
image_src_x : 500
image_src_y : 375
image_src_pixels : 187500
image_src_type : jpg
image_src_bits : 8
My own logging shows:
FATAL: exception with message 'unlink(67e103b0761e60683e83c559be18d40c.) [function.unlink]: No such file or directory' in /home/boardh/web/index.php:80 Stack trace: #0 [internal function]: ErrorHandler(2, 'unlink(67e103b0...', '/home/boardh/ap...', 3036, Array) #1 /home/boardh/application/lib/upload.class.php(3036): unlink('67e103b0761e606...') #2 /home/boardh/application/controllers/photocontroller.php(92): upload->process('/home/boardh/we...') #3 [internal function]: photoController->upload() #4 /home/boardh/application/models/frontcontroller.php(78): ReflectionMethod->invoke(Object(photoController)) #5 /home/boardh/web/index.php(87): FrontController->route() #6 {main}
So it looks like im getting a "No such file or directory" caused by line 3036 of the class -
Any thoughts would eb appreciated, its got me stumped!!
Best regards, Ben.
Can you replace this line with the following?
So we should have more information.
And are you sure it fails only when you use file_max_size code?