Creates a file selector object with a single-line text input control and a browse button.
With this control you can allow file uploading to a server. Clicking on the browse button opens the operating system dependent file dialog that allows the user to select a file to upload.
By default, the file selection control only supports single file selection, but with the MULTIPLE attribute, you can allow users to select more than one file with one file selection control.This control is one of the form controls.
The selected files can be submitted to a server if the following conditions are met:
- A form element must contain the file selection control.
- The action attribute of the container form must be set to the URL of the server.
- The method attribute of the container form must be set to 'post'.
- The encType attribute of the container form must be set to 'multipart/form-data'.
- The name attribute of the file selection control must be specified and non-empty.
If you want to see the HTML tags by categories, please visit this page.
This element cannot have a closing tag.
Example HTML code 1:
This example illustrates the use of the file selection element:
Did you find this example helpful?
User Contributed Comments