Fast and complete the task (modify according to your needs):
// Inside component fileUploaded(event: any) { const file = event.srcElement.files[0]; this.form.get('file').patchValue(file); } // Inside template <input type="file" (change)="fileUploaded($event)">
source share