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.
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|
Used to give a name to the control which is sent to the server to be recognized and get the value
Specifies the types of files that the server accepts.