Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can i make file dialog in input type file in html to be multi select?

I want to implement a multi file upload I was thinking if its possible to have a browse button open a file dialog which may allow me to select more than one file and once i select them these files can upload. I am doing this on a website and using php jQuery etc.

By looking at the answers i feel that multi-select is not possible. So i am updating my question to this : Can i select a zip file and get a set of file objects inside zip file and then work on individual file objects.

like image 338
sushil bharwani Avatar asked Aug 12 '10 17:08

sushil bharwani


People also ask

How do you select multiple inputs in HTML?

For windows: Hold down the control (ctrl) button to select multiple options. For Mac: Hold down the command button to select multiple options.

How do you make an input type file multiple?

Tip: For <input type="file"> : To select multiple files, hold down the CTRL or SHIFT key while selecting. Tip: For <input type="email"> : Separate each email with a comma, like: [email protected], [email protected], [email protected] in the email field.

How do you create a Choose file option in HTML?

The <input type="file"> defines a file-select field and a "Browse" button for file uploads. To define a file-select field that allows multiple files to be selected, add the multiple attribute. Tip: Always add the <label> tag for best accessibility practices!

How do you specify a file type in HTML input?

<input type="file"> <input> elements with type="file" let the user choose one or more files from their device storage. Once chosen, the files can be uploaded to a server using form submission, or manipulated using JavaScript code and the File API.


3 Answers

In some of the more up-to-date browsers that support HTML5 (i.e. Firefox, Chrome, Safari), the multiple attribute will work:

<label>Select files: <input name="files" type="file" multiple></label>
like image 54
You Avatar answered Nov 12 '22 22:11

You


Gmail allows selecting multiple files as attachments by using a Flash control just for the upload.

like image 24
KatieK Avatar answered Nov 12 '22 22:11

KatieK


Nope, that's not possible, you can specify one file at a time for a single file type. On the other hand, you might want to have a look at:

  • jQuery Multiple File Upload Plugin
like image 32
Sarfraz Avatar answered Nov 12 '22 23:11

Sarfraz