Multiple Image Upload Preview before image uploading

Good Morning To all,
This article provides you to simple description with example and source code based on Multiple Image Upload Preview before image uploading.
Upload multiple image using html and also provide multiple image preview. When ever we are uploading image we need instant image preview, for that we are going to use HTML5 filereader, jQuery Upload multiple images with preview.
The FileReader object is used to asynchronously read the files from user’s computer.



demo




Code







Multiple Image upload Preview

Photo




ajaxImageUpload.php

  $value)
    {
	
        $filename = stripslashes($_FILES['photos']['name'][$name]);
        $size=filesize($_FILES['photos']['tmp_name'][$name]);
        //get the extension of the file in a lower case format
          $ext = getExtension($filename);
          $ext = strtolower($ext);
     	
         if(in_array($ext,$valid_formats))
         {
	       if ($size < (MAX_SIZE*1024))
	       {
		   $image_name=time().$filename;
		   echo "";
		   $newname=$uploaddir.$image_name;
           
           if (move_uploaded_file($_FILES['photos']['tmp_name'][$name], $newname)) 
           {
	      
	       }
	       else
	       {
	       echo 'You have exceeded the size limit! so moving unsuccessful! ';
            }

	       }
		   else
		   {
			echo 'You have exceeded the size limit!';
          
	       }
       
          }
          else
         { 
	     	echo 'Unknown extension!';
           
	     }
           
     }
}

?>





download

I hope this post is really helpful for all, thanks for visiting, Keep visiting for more updates.

Leave a Reply

Your email address will not be published. Required fields are marked *