Read More
Read More
Menu Close

    Send Images through ajax

    1. In this tutorial we are going to tell you that how to send an image through ajax to process.

    2. In the following code you can process image as soon as it is selected.

    3. First  You need to Select image file through following line of html code

    <input type="file" id="image_to_upload"/>

    4. After that you need to write the following jQuery code to catch this event.

    <script type="text/javascript">
    	formdata = new FormData();		
    	jQuery("#image_to_upload").on("change", function() {
    		var file = this.files[0];
    		if (formdata) {
    			formdata.append("image", file);
    				url: "destination_ajax_file.php",
    				type: "POST",
    				data: formdata,
    				processData: false,
    				contentType: false,

    5. In the destination ajax file you can access image by the following variable

    Start your headless eCommerce
    Read More

    6.That is it Save And Enjoy!!

    . . .
    Discuss on Helpdesk

    Leave a Comment

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

    Be the first to comment.

    Back to Top