Hello I have a simple for and PHP that uploads multiple images to a file. The problem is I want these images to be resized when they are uploaded. Does anyone know of a simple way to resize these images with PHP? I am not a professional so further explaining would be helpful. Here is my current HTML form and PHP upload script.

    $errors= array();
    foreach($_FILES['files']['tmp_name'] as $key => $tmp_name ){
        $file_name = $key.$_FILES['files']['name'][$key];
        $file_size =$_FILES['files']['size'][$key];
        $file_tmp =$_FILES['files']['tmp_name'][$key];
        if($file_size > 10097152){
            $errors[]='File size must be less than 2 MB';
        $query="INSERT into upload_data (`USER_ID`,`FILE_NAME`,`FILE_SIZE`,`FILE_TYPE`) VALUES('$user_id','$file_name','$file_size','$file_type'); ";
                mkdir("$desired_dir", 0700);        // Create directory if it does not exist
            $file_name = md5($file_name.time());
            $file_name = $file_name.".jpg";
        echo "Success";


<form action="" method="POST" enctype="multipart/form-data">
    <input type="file" name="files[]" multiple/>
    <input type="submit"/>


Re: Resize multiple images on upload - PHP 80 80

Thanks for the reply, but I don't understand this website. Can you give me a further explanation?

Re: Resize multiple images on upload - PHP 80 80

Try this Click Here

Re: Resize multiple images on upload - PHP 80 80

where is resize code

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.