Tutorials References Exercises Bootcamps Videos Menu
Sign Up Create Website Get Certified Upgrade

HTML <input type="file">

❮ HTML <input> type attribute


Define a file-select field:

<label for="myfile">Select a file:</label>
<input type="file" id="myfile" name="myfile">
Try it Yourself »

Definition and Usage

The <input type="file"> defines a file-select field and a "Browse" button for file uploads.

To define a file-select field that allows multiple files to be selected, add the multiple attribute.

Tip: Always add the <label> tag for best accessibility practices!

Browser Support

The numbers in the table specify the first browser version that fully supports the element.

type="file" 1.0 Yes 1.0 1.0 1.0


<input type="file">

❮ HTML <input> type attribute