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.
more info about the class
See all posts See thread Reply
if ($_POST['action'] == 'local') { $handle = new Upload($_FILES['user_img']); $handle->mime_check = false; $handle->allowed = array("image/bmp", "image/gif", "image/jpeg", "image/png", "image/jpg"); if ($handle->uploaded) { $handle->image_resize = true; $handle->image_ratio = true; $handle->image_y = 106; $handle->image_x = 100; $handle->file_name_body_add = '_'.$current_userid; $handle->Process('./user_image/'); $upload_image_name = $handle->file_dst_name; } if($upload_image_name=='') { //business logic } else { //business logic } }