[Library]: BulkComponent: add on allowed file types applicaton/vnd.ms-excel for csv.

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@56955 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
k.triantafyllou 2019-09-03 13:11:20 +00:00
parent 6d49be8553
commit efcb959e28
1 changed files with 3 additions and 1 deletions

View File

@ -130,11 +130,13 @@ export class BulkClaimComponent {
this.enableUpload = false;
this.showReport = false;
this.errorMessage = "";
console.log(this.filesToUpload);
if (this.filesToUpload.length == 0) {
this.errorMessage = "There is no selected file to upload.";
return;
} else {
if (this.filesToUpload[0].name.indexOf(".csv") == -1 || this.filesToUpload[0].type != "text/csv") {
if (this.filesToUpload[0].name.indexOf(".csv") == -1 ||
(this.filesToUpload[0].type != "text/csv" && this.filesToUpload[0].type != "application/vnd.ms-excel")) {
this.errorMessage = "No valid file type. The required type is CSV";
return;
}