Hi,
I have following Jquery in mvc core view:
$(document).ready(function () {
$("#btnUploadSave").click(function () {
var fileUpload = $("#files").get(0);
var files = fileUpload.files;
var data = new FormData();
for (var i = 0; i < files.length; i++) {
data.append(files[i].name, files[i]);
}
$.ajax({
type: "POST",
url: "/Creator/SaveBatchMenbersFromExcel",
contentType: false,
processData: false,
datatype : json,
data: data,
headers: { __RequestVerificationToken: $("input[name=__RequestVerificationToken]").val() },
success: function (message) {
alert(message);
$("#txtExcelFile").val('');
$("#txtExcelFile").attr("placeholder", "Drop a file here!");
$('#ddlBatchCsv').prop('selectedIndex', 0);
},
error: function () {
alert("There was error uploading files!");
}
});
});
and below is the html of input
while saving data of excel file I am always getting alert of error function. Please help me where is the mistake??

Ramesh PalanivelRank #372 · 6.8K reputationPosted Apr 17, 2018, 9:18 PM EDT
meenakshi luthra51 reputationPosted Apr 17, 2018, 9:28 PM EDT
Ramesh PalanivelRank #372 · 6.8K reputationPosted Apr 17, 2018, 9:46 PM EDT
Ramesh PalanivelRank #372 · 6.8K reputationPosted Apr 17, 2018, 9:10 PM EDT
meenakshi luthra51 reputationPosted Apr 17, 2018, 9:14 PM EDT
meenakshi luthra51 reputationPosted Apr 17, 2018, 9:26 PM EDT
Ramesh PalanivelRank #372 · 6.8K reputationPosted Apr 17, 2018, 9:39 PM EDT
meenakshi luthra51 reputationPosted Apr 17, 2018, 9:45 PM EDT
meenakshi luthra51 reputationPosted Apr 17, 2018, 9:55 PM EDT
Ramesh PalanivelRank #372 · 6.8K reputationPosted Apr 17, 2018, 10:03 PM EDT
meenakshi luthra51 reputationPosted Apr 17, 2018, 10:05 PM EDT
Ramesh PalanivelRank #372 · 6.8K reputationPosted Apr 17, 2018, 10:10 PM EDT
meenakshi luthra51 reputationPosted Apr 17, 2018, 10:11 PM EDT