As per my understanding, when I upload .xlsx file from pc which has installed MS Excel it gives me type= application/vnd.openxmlformats-officedocument.spreadsheetml.sheet and when I upload same file from pc which has not MS Excel installed it gives me type="". The following jquery code checks twice in if condition as inputFile.type="application/"
$("#btnUpload").change(function () {
var inputFile = $(this).get(0).files[0];
if (inputFile != undefined || inputFile != null) {
if (inputFile.type == ".csv" || inputFile.type == "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" || inputFile.type == "application/vnd.ms-excel") {
$("#uploadedFileName").html(inputFile.name)
} else {
errorToast("Please select valid file format");
}
} else {
errorToast("Please select file");
}
});
Please help me out with the role of application/ prefix. or correct my understanding.