Skip to content
Related Articles

Related Articles

Improve Article

How to create a file upload button in HTML ?

  • Last Updated : 27 Sep, 2021
Geek Week

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

Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.

My Personal Notes arrow_drop_up
Recommended Articles
Page :