DEV Community

Programming Dive
Programming Dive

Posted on

How to upload Image using AJAX and Javascript?

In the previous post, we learned how to upload Image using AJAX and PHP and now in this post we’ll learn How to upload Image using AJAX and Javascript. We will also look into uploading file(s) via AJAX and JQuery in the very next post.

So, in this case we require .html file for creating form and write our AJAX code in Javascript and one .php file to write server side code for uploading a file & storing it at the desired location.

In the previous post, we performed all the validation operations in .php file itself which is called as server side validation. Here, in the post we’ll apply same validation as a client side validation on uploaded file.

First, we’ll go through the HTML code from which we’ll upload file.

https://programmingdive.com/how-to-upload-image-using-ajax-and-javascript/

Top comments (0)