How to Allow Multiple File Uploads in HTML Forms

allow multiple file uploads

Here’s how to allow multiple file uploads using a single file input control in your HTML website projects.

If you want to allow a user to upload the file to your website, you need to use a file upload box, also known as a file select box. This is created using the element and the type attribute is set to file.

To allow multiple file uploads in HTML forms, use the multiple attributes. The multiple attributes work with email and file input types.

Read Also  Unreal Engine 4.14 Release is now Available

Example:
You can try to run the following code to select multiple files and be able to pick up multiple files at once for uploading.

<!DOCTYPE html>
<html>
   <head>
      <title>Upload multiple files</title>
   </head>

   <body>
      <form>
         <input type="file" name="name" multiple><br><br>
         <input type="submit" value="Submit">
      </form>
   </body>
</html>

Once you hit the submit button the files will be uploaded to the server where it can be handled by the appropriate underlying back-end technology.