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

shamon shamsudeen
  • 5,466
  • 17
  • 64
  • 129

1 Answers1

1
<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
  • 31
  • 7