- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How do we upload external file on a website using HTML forms?
If you want to allow a user to upload an external file to your website, you need to use a file upload box, also known as a file select box. This is also created using the <input> element but type attribute is set to file.
Example
You can try to run the following code to upload an external file to your website −
<!DOCTYPE html> <html> <head> <title>File Upload</title> </head> <body> <form> <input type = "file" name = "upload" accept = "image/*" /> </form> </body> </html>
Here are the attributes of the file upload box −
Sr.No | Attribute & Description |
1 | name Used to give a name to the control which is sent to the server to be recognized and get the value |
2 | accept Specifies the types of files that the server accepts. |
- Related Articles
- How do we do a file upload using Python CGI Programming?
- How do we send an email using HTML forms?
- How to upload a file using JSP?
- How do we use radio buttons in HTML forms?
- How do we use checkbox buttons in HTML forms?
- How do we take password input in HTML forms?
- How to create a file upload button with HTML?
- How can you upload a file using JSP?
- How to load external website into an using jQuery?
- How do we reset all the input fields in HTML forms?
- Why do we use reset button in HTML forms?
- How do we use a simple drop-down list of items in HTML forms?
- Cross-browser drag-and-drop HTML file upload?
- How to create a website without using HTML?
- How to handle windows file upload using Selenium WebDriver?

Advertisements