HTML | <input type=”file”>

The HTML <input type=”file”> is used to specify the file select field and add a button to choose a file for upload to the form.

Syntax:

<input type="file"> 

Example:



filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html> 
<html
  
<head
    <title
        HTML input type file
    </title
      
    <style
        h1 { 
            color: green; 
        
        h3 { 
            font-family: Impact; 
        
        body { 
            text-align: center; 
        
    </style
</head
  
<body
    <h1
        GeeksforGeeks 
    </h1
      
    <h3
        HTML <Input Type = "File"
    </h3
  
    <input type="file" id="myFile"
      
    <p id="submit_text"></p>
</body
  
</html>                    

chevron_right


Output:

Supported Browsers: The browsers supported by <input type=”file”> are listed below:

  • Google Chrome 1.0
  • Internet Explorer
  • Firefox 1.0
  • Safari 1.0
  • Opera 1.0


My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.