Upload an image without a form submitting using ajax

Upload an image without a form submitting using ajax

Today, In this tutorial, we will be explaining how to Upload an image without a form submitting using ajax. many people say it is possible to upload an image without a form submitting but it is possible. so let’s go we use this tutorial to make possible.

We have used jquery and ajax and in this below file. we have taken also FormData() object.

When the user clicks on button then we will get the image data and it is passed into FormData() object and call the ajax with FormData() object data.

index.php

upload.php

When ajax call the upload.php file then the image will be upload into images directory.

Please follow and like us: