views:

964

answers:

3

Hi,

I was trying to do something like this: http://www.element-it.com/Examples/MultiPowUpload/AdvancedHTMLinterface.html

But in my search for information I found that is not possible to perform multiple file selection with simple HTML and JavaScript (and JSP in the server side). There is a way to do this without using Flash? A third party component you could recommend?

Thanks.

+4  A: 

It is still works via flash, but the YUI Uploader component allows you to add multiple file selection with minimal knowledge of flash - the API to interact with it is purely javascript.

HTML 5 will support multiple file upload, but that is not currently well supported in a large number of browsers

Chi
+1  A: 

Actually according to the specification, normal HTML file upload fields are supposed to be multiple-file-upload fields. Opera supported it for a bit, allowing you to ctrl-click to select multiple files from a file picker. But it almost always broke the webapp since many web frameworks didn't know about it and would fall over.

In the meantime, it usually suffices to use JavaScript to add an extra file upload field to the form when the previous one has been filled in. This can be made gracefully-degrading for non-JS UAs, whilst sprucing up the management of multiple files with script and pretty icons.

If you go with a Flash uploader, it's a good idea to back it up with a simple HTML file upload field for compatibility there too.

bobince
Thanks bobince, I ended following an approach similar to the one you described, I'll be using a Flash control, but I'll keep a simple HTML solution just in case.
Abel Morelos
A: 

If you prefer to use JQuery - check out this plugin (it's very nice)

http://www.uploadify.com

Jiaaro