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??
meenakshi luthraPosted Apr 18, 2018, 2:11 AM
Ramesh PalanivelPosted Apr 18, 2018, 2:10 AM
meenakshi luthraPosted Apr 18, 2018, 2:05 AM
Ramesh PalanivelPosted Apr 18, 2018, 2:03 AM
meenakshi luthraPosted Apr 18, 2018, 1:55 AM
Ramesh PalanivelPosted Apr 18, 2018, 1:46 AM
meenakshi luthraPosted Apr 18, 2018, 1:45 AM
Ramesh PalanivelPosted Apr 18, 2018, 1:39 AM
meenakshi luthraPosted Apr 18, 2018, 1:28 AM
meenakshi luthraPosted Apr 18, 2018, 1:26 AM
Ramesh PalanivelPosted Apr 18, 2018, 1:18 AM
meenakshi luthraPosted Apr 18, 2018, 1:14 AM
Ramesh PalanivelPosted Apr 18, 2018, 1:10 AM