views:

91

answers:

2

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.

A: 

Philosophically, uploading presents risks to the user. Making this too easy might be a pain for some applications, but all in all, it probably should be. Why not suggest the user zip the individual files into one archive and upload only that?

wallyk
+1  A: 

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.

Michael Borgwardt