Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple files select and upload

i am using this code for upload files to a server(in html):

    <form action="" method="post" enctype="multipart/form-data" name="form1" id="form1">     <label>upload file<input type="file" name="file" id="file" /></label>     <label><input type="submit" name="button" id="button" value="Submit" /></label></form> 

It's open file browser and let me select a file,and when i press on Submit the file is sent to my server.

i wonder if there is a way to make multiple file select.

like image 341
YosiFZ Avatar asked Dec 29 '11 15:12

YosiFZ


People also ask

How do you select multiple files to upload in HTML?

Tip: For <input type="file"> : To select multiple files, hold down the CTRL or SHIFT key while selecting.

How do I add multiple files at once?

Click the first file or folder you want to select. Hold down the Shift key, select the last file or folder, and then let go of the Shift key. Hold down the Ctrl key and click any other file(s) or folder(s) you would like to add to those already selected.

Which input type is used for multiple selection?

The multiple attribute is a boolean attribute. When present, it specifies that multiple options can be selected at once. Selecting multiple options vary in different operating systems and browsers: For windows: Hold down the control (ctrl) button to select multiple options.


1 Answers

You can use the multiple attribute for that, like this:

<input type="file" multiple /> 

To select multiple files you need to press the Ctrl key and click on the files you want to add.

like image 184
js-coder Avatar answered Sep 29 '22 09:09

js-coder