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 property is read-only, because of security reasons.
Syntax:
fileuploadObject.value
Example: Return the “path”.
<!DOCTYPE html> <html> <head> <title> HTML DOM Input FileUpload value </title> <style> h1 { color: green; } </style> </head> <body> <center> <h1> Geeks for Geeks </h1> <input type="file" id="myFile" required> <p id="demo"></p> <button onclick="myFunction()"> Click </button> <script> function myFunction() { var x = document.getElementById( "myFile").value; document.getElementById( "demo").innerHTML = x; } </script> </center> </body> </html> |
Output:
Before Clicking the Button:

After Clicking the Button:

Supported Browsers:
- Google Chrome
- Mozilla Firefox
- Edge 10.0
- Opera
- Apple Safari
Recommended Posts:
- HTML | DOM Input FileUpload name Property
- HTML | DOM Input FileUpload required Property
- HTML | DOM Input FileUpload form Property
- HTML | DOM Input FileUpload autofocus Property
- HTML | DOM Input FileUpload files Property
- HTML | DOM Input FileUpload disabled Property
- HTML | DOM Input FileUpload multiple Property
- HTML | DOM Input FileUpload accept Property
- HTML | DOM Input FileUpload type Property
- HTML | DOM Input FileUpload Object
- HTML | DOM Input URL name Property
- HTML | DOM Input URL value Property
- HTML | DOM Input DatetimeLocal max Property
- HTML | DOM Input Submit name Property
- HTML | DOM Input Month value Property
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : shubham_singh



