PHP Ajax Image Upload Resize Crop using jQuery

Today, We want to share with you PHP Ajax Image Upload Resize Crop using jQuery.In this post we will show you ajax image upload and crop with jquery and php, hear for Image Upload,Crop and Resize Using PHP, jQuery and Ajax we will give you demo and example for implement.In this post, we will learn about Live Image Upload, Crop and Resize using jQuery and PHP MySQL with an example.

PHP Ajax Image Upload Resize Crop using jQuery

There are the Following The simple About PHP Ajax Image Upload Resize Crop using jQuery Full Information With Example and source code.

As I will cover this Post with live Working example to develop PHP laravel crop image before upload, so the php image resize on upload for this example is following below.

Step 1: Javascript With Include External CDN

Javascript Source Code

Step 2 : HTML Interface


Upload image:

Step 3 : CREATE A Table

Users MySQL Table

CREATE TABLE `members` (
`username` varchar(255) UNIQUE KEY,
`password` varchar(100),
`email` varchar(255) UNIQUE KEY,
`profile_image` varchar(200)

Step 4: jquery Ajax Call To server side



//Original Image
if(move_uploaded_file($livefileUpload, $path.$orignal_upload))
//Insert upload image files names into user_uploads table
mysqli_query($db,"UPDATE members SET profile_image='$orignal_upload' WHERE uid='$member_session_profile';");
echo "PHP Ajax Image Upload Resize Crop using jQuery";
echo "failed";
echo "Image file size max 1 MB"; 
echo "Invalid file format.."; 
echo "Please select image..!";

Step 5 : Serever Side Resize with Compress an Image


Simple Your Images Re-sizing image into All the different some more pixel dimensions.


function getExtension($captionstr)
$i = strrpos($captionstr,".");
if (!$i)
return "";
$l = strlen($captionstr) - $i;
$flext = substr($captionstr,$i+1,$l);
return $flext;

Step 6 : Database Config File


Simple Main Global file Database config file.

Angular 6 CRUD Operations Application Tutorials

Read :


You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about PHP Ajax Image Upload Resize Crop using jQuery.
I would like to have feedback on my blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Leave a Comment