Reputation: 11
I need the full path of the file when user selects a file from Choose File using typeScript. I tested some codes but i got only the name of the file.
public onFileSelected(event: EventEmitter<File[]>) {
const file: File = event[0];
this.fileName = file.name;
}
Upvotes: 0
Views: 205
Reputation: 54
You will not get full path of selected file.Because it will always throw warning and will give fakepath.If you want to preview that particular file then there is a way to do that wihtout using full path of file.
Upvotes: 0
Reputation: 32517
You wont get full path as it would be security hole - leaking directory structure and potentially vulerable information (like user name for example)
Upvotes: 2