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
include('lib/class.upload.php'); $file = "image.jpg"; $files = "new-image.jpg"; $handle = new upload($file); if ($handle->uploaded) { if ($handle->processed) { $handle->file_new_name_body = $files; $handle->image_resize = true; $handle->image_y = 400; $handle->image_ratio_x = true; header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename='.basename($files)); $handle->process("$file"); echo $handle->Process(); die(); } else { echo 'error : ' . $handle->error; } }
i mean, i use code base on that code, but not working.
here my code
that code download same image as original without modification.