1

In my angular5 File upload is a trigger onchange event, but when I select the same file twice it's not selected.

My problem similar to this HTML input file selection event not firing upon selecting the same file

<input type="file" class="upload-file" onclick="this.value=null"  (change)="handleFileInput($event.target.files,'doc')">

but its not working

shellakkshellu
  • 4,908
  • 15
  • 59
  • 110

1 Answers1

0
<input #fileInput type="file" id="fileid" (click)="fileInput.value = null" value="" (change)="handleFileInput($event)" >

every time you click on file input it will clear its value so even if you select the same file (change) will fire.

Suji V
  • 1
  • 2