WordPress upload image using ajax.

upload image using Ajax

Here i am going to give you full code to save image in a folder and show preview.

There are many ways to upload image using ajax in wordpress like you can use HTML form then you will call Ajax on submit form but some time you may face a situation where does not want to form just input file and a button to upload image.

First create an input file with button, just copy below html code.

Ajax call

Don’t forget to include Jquery library.

Upload image

Put this code to your theme functions.php

Gaurav Kumar

Hi, my name is Gaurav Kumar and I specialize in the Computer Software industry. I have been working as a Software Developer, and it's my passion to learn new things and sharing what I've learned.

Leave a Reply

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