Skip to content
Related Articles
Open in App
Not now

Related Articles

How to create a file upload button in HTML ?

Improve Article
Save Article
  • Last Updated : 27 Sep, 2021
Improve Article
Save Article

In this article, we will see how to make a file upload button to upload a file using HTML. As we know, uploading a file is an important aspect in simple HTML form. The file upload button is used to upload a user photo or any type of file in a form. 

Approach: For uploading the file using HTML, we will

  • create a HTML document that contains an <input> tag.
  • use the type attribute which is set to value “file”.


<input type="file">



<!DOCTYPE html>
    <title>HTML input type file</title>
    <!--CSS code-->
        h1 {
            color: green;
        h3 {
            font-family: Impact;
        body {
            text-align: center;
        How to create a file Upload
        Button using html?
    <label> Choose the File to upload: </label>
    <input type="file" id="myFile" /> <br /><br />
    <input type="submit" value="submit" />

Output: You can see that after the file is uploaded, the name of the file is displayed in front of the button. 

File upload button in HTML

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!