Web APIs
File.name
Expose the file name without supplying the original local filesystem path. Treat it as untrusted display data. Example console output: note.txt.
Formal Syntax & Structure
javascript syntaxjavascript
file.nameReturn Value
string
File name.
Working Example
Example Snippetjavascript
const f=new File(["hi"],"note.txt"); console.log(f.name);