var ALLOWED_EXTENSIONS = [".xlsx", ".csv", ".txt", ".json"];
$("#upload").kendoUpload({
async: {
saveUrl: "BOQImport.aspx/uploadFile"
},
multiple: false,
localization: {
"select": "Select file to import..."
},
select: function (e) {
var extension = e.files[0].extension.toLowerCase();
if (ALLOWED_EXTENSIONS.indexOf(extension) == -1) {
alert("Please, select a supported file format");
e.preventDefault();
}
},
success: function (e) {
// Load the converted document into the spreadsheet
spreadsheet.fromJSON(e.response);
},
error: function (e) {
console.log(e);
},
})