1 var postData = new FormData($("#modal_form_id")[0]);
2
3 $.ajax({
4 type:'POST',
5 url:'your-post-url',
6 processData: false,
7 contentType: false,
8 data : postData,
9 success:function(data){
10 console.log("File Uploaded");
11 }
12
13 });
14
1 <form enctype="multipart/form-data" id="modal_form_id" method="POST" >
2 <input type="file" name="documents">
3 </form>
4