I am trying to have a file input which accepts only excel file.
<div mat-dialog-content class="p-24 pb-0 m-0" fusePerfectScrollbar>
<div fxLayout="row" style="margin-top: 1rem;">
<input type="file" accept=".xlsx, .xls, .csv" (change)="uploadFile($event)">
</div>
</div>
in TS file-
uploadFile(event): void {
const fileForm = event.target.files[0];
this.formDataForm.append('file', fileForm);
}
I want to restrict the user from uploading any type of other file, but any file type is uploaded now. accept attribute is not working here.