A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.geeksforgeeks.org/html/html-input-typefile/ below:

HTML <input type="file"> - GeeksforGeeks

HTML <input type="file">

Last Updated : 20 May, 2024

The HTML <input type="file"> element is used to create a file input box in forms. It allows users to browse and select files to upload from the devices. When the form is submitted, the selected file(s) can be uploaded to the server.

Syntax
<input type="file"> 

Example: In this example, we will demonstrate the use of the HTML <input type="file"> element.

HTML
<!DOCTYPE html>
<html>

<head>
    <title>
        HTML Input Type File
    </title>
</head>

<body style="text-align: center;">
    <h2>HTML &lt;input type = "file"&gt;</h2>

    <form action="#">
        <label for="image_file">Select Image</label>
        <input type="file" id="image_file">
    </form>
</body>

</html>

Output

Supported Browsers

The browsers supported by <input type="file"> are listed below:



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4