Amal Kallel
Amal Kallel

Reputation: 11

Full path of selected file

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

Answers (2)

Ishan Bhatt
Ishan Bhatt

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

Antoniossss
Antoniossss

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

Related Questions