To upload I file in Angular, I am doing this:
<input type="file" (change)="onFileSelected($event.target.files)"/>
<button (click)="onStartUpload()"</button>
public onFileSelected(files: File[]) {
this.file = files[0];
}
public onStartUpload() {
// Upload the file
}
This works perfectly. But when I select a file, then change its content and save it, and then upload it, my backend response is this:
Unexpected end of Stream, the content may have already been read by another component.
This only happens with Firefox. It works fine in Chrome.
Update: With Chrome's latest update, it does not send the request anymore.
How can I check if the file has been changed after I selected it in the browser?