Answers for "ajax file upload from modal"

0

ajax file upload from modal

<form enctype="multipart/form-data" id="modal_form_id"  method="POST" >
    <input type="file" name="documents">
 </form>
Posted by: Guest on January-10-2021
0

ajax file upload from modal

var postData = new FormData($("#modal_form_id")[0]);

                         $.ajax({
                                 type:'POST',
                                 url:'your-post-url',
                                 processData: false,
                                 contentType: false,
                                 data : postData,
                                 success:function(data){
                                   console.log("File Uploaded");
                                 }

                              });
Posted by: Guest on January-10-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language