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.
The code is below. I notice that the $_FILES['binFile'][size] always returns 0 on files larger than about 750 to 800 Kb. but it is correct on files smaller.
The code is below. I notice that the $_FILES['binFile'][size] always returns 0 on files larger than about 750 to 800 Kb. but it is correct on files smaller.
The php.ini settings are
My code:
$upload = new upload($_FILES['binFile']); $upload->file_max_size = 4096; if ($upload->uploaded) { $upload->allowed = array('image/jpeg','image/pjpeg','image/jpg','image/gif','image/png'); $upload->image_convert = 'jpg'; $upload->file_new_name_body = $record; $upload->image_resize = true; $upload->image_x = $full_width; $upload->image_ratio_y = true; $upload->process($img_basedir.'/full/'); if ($upload->processed) { echo 'Full Image Resized'; $success = 1; } else { echo 'Error : ' . $upload->error; } echo $upload->log; }Regards!