//var fileInput = document.getElementById('fi'); var count = $("input[type=file]") for (j = 0; j < count.length; j++) { var formdata = new FormData(); //FormData object var fileInput = document.getElementById(count[j].id); //Iterating through each files selected in fileInput for (i = 0; i < fileInput.files.length; i++) { //Appending each file to FormData object formdata.append(fileInput.files[i].name, fileInput.files[i]); } //Creating an XMLHttpRequest and sending $.ajax( { url: '/Booking/Upload', type: 'POST', contentType: false, processData: false, data: {formdata ,"file":"1" }, success: function (data) { alert(data); } });
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)