How to upload image using Ajax request?

Upload an image file using ajax jquery?

  • 0    http://...         http://stackoverflow.com/questions/16570336/uploading-a-file-with-ajax-in-ie-7-10#                                               I have successfully used ajax formdata for file uploading,  however It does not work on versions of Internet Explorer lower than 10.  Is there any JQuery plugins that support file uploading without using  Flash, or IFrames and must run on an IPad (which is why we can't use  flash). Otherwise , if the is no jQuery plugins, any other suggestions would be  grateful helpful!

  • Answer:

    Use http://malsup.github.io/min/jquery.form.min.js. HTML <form id="myForm" action="comment.php" method="post"> Name: <input type="text" name="name" /> Comment: <textarea name="comment"></textarea> <input type="submit" value="Submit Comment" /> </form> JavaScript <script> // wait for the DOM to be loaded $(document).ready(function() { // bind 'myForm' and provide a simple callback function $('#myForm').ajaxForm(function() { alert("Thank you for your comment!"); }); }); </script>

Sudhanshu Mishra at Quora Visit the source

Was this solution helpful to you?

Other answers

You need jquery plugin along with jquery.form.js plugin to upload image via ajax to the server. http://malsup.com/jquery/form/ Please refer following tutorial for ajax image upload http://www.smarttutorials.net/ajax-multiple-image-upload-with-resize-using-jquery-php-and-mysql/

Muni Ayothi

From this http://whats-online.info/science-and-tutorials/30/select-preview-rename-and-upload-image-using-jquery-Ajax/, there is complete working demo that shows file previewing before uploading (client side) and then uploading to the server using jquery Ajax and PHP (server side). Hope it will completely help you.

Dansyo Stylagard

You can find an excellent working implementation of uploading image using XMLHttpRequesthttp://getgoingit.blogspot.in/2016/05/uploading-file-using-ajax-and-wcf-rest.html.

Ankur Gupta

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.