Get the name attribute value: document.write(document.getElementById("myFile").name);
``` Output: ``` myFile ``` --- ## More Examples ### Example 1 The following example demonstrates how to set the name of the file upload control: ```html Select File: function myFunction() { var x = document.getElementById("myFile").name = "newName"; document.getElementById("demo").innerHTML = x; } ```Prop Fileupload Name
# FileUpload name Property
## Definition and Usage
The name property sets or returns the value of the name attribute of a file upload control.
The name attribute defines a unique name for the file upload control, and when the form data is submitted, the name attribute value and the control's value are submitted to the server as a key-value pair.
## Browser Support
| !( | !( | !( | !( | !( |
| Chrome | Edge | Firefox | Opera | Safari |
| Yes | Yes | Yes | Yes | Yes |
**Note:** Internet Explorer 8 and earlier versions do not support the `` tag.
## Syntax
```javascript
fileuploadObject.name
```
## Property Values
| Value | Description |
|---|---|
| name | String, representing the value of the name attribute of the file upload control. |
## Return Value
Returns a string, representing the value of the name attribute of the file upload control.
## Technical Details
| DOM Version | Core Level 2 Property |
|---|---|
## Example
The following example can get the name of the file upload control:
```html
Select File:
YouTip