Reputation: 13
<input #fileInput hidden="true" type="file" accept="*" (onChange)="uploadFile($event)"/>
and in my component.ts
uploadFile(fileEvent){}
Upvotes: 1
Views: 250
Reputation: 575
Javascript will not allow you to read a file that was not selected through file selector for security reasons. It would be a major security breach if you entered a web page and it could read randomly files in your system.
Upvotes: 1