Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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");
                                 }

                              });
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #ajax #file #upload #modal
ADD COMMENT
Topic
Name
1+5 =