Home / Web Development / Ajax / PHP AJAX Image Upload

PHP AJAX Image Upload

Hi all,
In this article shows how to upload an image file using PHP and AJAX. In here, we are sending form data to PHP script using ajax(). First we upload the image through PHP form and return success message as AJAX response.

Table Of Content

  1. The HTML
  2. Ajax
  3. Stylesheet/CSS

The HTML

HTML part is very important part in web development. The <input> tag is specified in HTML part.
For upload image we specify the type=”file” in input tag like: <input type=”file” name=”user_Image” />

AJAX

Stylesheet/ CSS

upload_image.php

Full Code

OUTPUT

upload1

After uploading image via AJAX, we are loading the image to the target layer in the left side of the above form. So the output will be:

upload2

Happy Coding

If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.

Leave a Reply

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

Social Media Auto Publish Powered By : XYZScripts.com