<input type=”file”>

Value of
<input type="">
What does <input type="file"> do?
Defines a file upload box with a browse button.

Code Example

<form action="myform.cgi">
<input type="file" name="fileupload" value="fileupload" id="fileupload">
<label for="fileupload"> Select a file to upload</label>
<input type="submit" value="submit">

In a form, the file value of the type attribute allows you to define an input element for file uploads. This displays a browse button, which the user can click on to select a file on their local computer.

Once a file has been selected, the file name appears next to the button.

Claire is seasoned technical writer, editor and HTML enthusiast.

Browser Support for file