Reputation: 11
The only tools/plugins I've seen online that allow for multiple files to be selected for upload through one single dialog box using a SHIFT or CTRL click action (as opposed to clicking on a single file per for file uploads) exist for controls made in Flash/.NET/Java, not just straight Javascript/HTML/PHP.
Why is that the case? I'd imagine that if possible, site developers would look to having less dependencies on different technologies rather than more.
Upvotes: 1
Views: 316
Reputation: 4560
It is quite old question, so needs some update. With HTML5 it is getting better. New attribute 'multiple' for <input...> tag is already supported by at least current versions of Firefox and Google Chrome. Now we just need to wait for IE to catch up...
Upvotes: 2
Reputation: 346260
That's because a HTML <input type="file">
element can only contain one file as per per spec - it's simply impossible to upload multiple files through it. And Javascript cannot fake a multi-file upload box because the file selection dialog is implemented by the browser and, as per spec, allows only one file to be selected. Javascript does not have access to the local file system and thus cannot replace that dialog.
Upvotes: 2