JavaScript File.name Property Last Updated : 30 Sep, 2024 Comments Improve Suggest changes Like Article Like Report The File.name property is an inbuilt function of File WebAPI which gives the name of the file represented by a file object. The path of file is excluded from this property for security reasons. Syntax:letname = file.name;Return Value: It returns a string, containing the name of the file without path. Example: Below is the implementation of the JavaScript File.name Property. html <!DOCTYPE html> <html> <head> <title> WebAPI File.name Property </title> <style> #main { padding: 10px; width: 300px; border: 1px solid green; text-align: center; font-size: 22px; } </style> </head> <body> <div id="main"> <div>GeeksForGeeks</div> <div>file.name</div> <input type="file" multiple onchange="myGeeks(this)"> </div> <script type="text/javascript"> function myGeeks(input_file) { let files = input_file.files; for (let i = 0; i < files.length; i++) { alert("Name of file:" + files[i].name); } } </script> </body> </html> Output:Supported Browsers: The browser supported by WebAPI File.name property are listed below: Edge 12Google Chrome 13Firefox 3.6Opera 16Safari Comment More infoAdvertise with us Next Article JavaScript File.name Property S sarthak_ishu11 Follow Improve Article Tags : JavaScript Web Technologies Similar Reads HTML | DOM Input FileUpload name Property The name property is used to set or return the value of the name attribute of a file upload button. The name attribute is used to identify form data after the submission to the server. Syntax: Return the name property:fileuploadObject.nameSet the name property:fileuploadObject.name=name Property Val 1 min read Node.js fs.dirent.name Property The fs.Dirent.name property is an inbuilt application programming interface of class fs.Dirent within File System module which is used to provide the name of the particular dirent. Syntax:Â const dirent.name Parameter: This property does not accept any parameter.Return Value: This property returns t 2 min read How to get the file name from page URL using JavaScript ? JavaScript provides multiple techniques for string manipulation and pattern matching. By demonstrating various methods, the article equips developers with versatile solutions to dynamically retrieve and utilize file names from different URL formats within their applications. There are several approa 3 min read HTML | DOM Object name Property The HTML | DOM Object name Property is used to set or return the value of a name attribute of an <object> element. The name attribute is used to specify the name of the embedded file. Syntax: It returns the name property objObject.nameIt is used to set the name property. objObject.name = name 2 min read HTML | DOM Input FileUpload value Property The Input FileUpload value Property is used to returns the path or the name of the file selected with the element. This property is used to return the name of the selected file with a fake path in IE, Google Chrome, and Opera, and return the name of the selected file in Firefox and Safari. This prop 1 min read Like