views:

127

answers:

3

I have a simple requirement:

  • One browse button opens multiple file choosers.
  • When file is chosen, its filename gets added to an order list.

This works just fine in IE, because i can programatically click on hidden file inputs, but firefox does not let the click event open the file choose dialog.

Question:

What options do i have? I noticed that gmail uses a piece of flash to make this happen, this isnt really an option for me, i need to stick to an html/javascript solution if possible.

Thanks.

+2  A: 

There is not much you can do aside from Flash because the file input fields have been locked down for security over the past few years. If you want, there are several freely available Flash uploaders that will do the trick you want.

Daniel A. White
+2  A: 

There's a reason GMail uses a piece of Flash: it is the best least-worst option. Some other sites I've seen use Java applets or their own browser add-on or Active-X component, which I find much more intrusive to the user than Flash.

If it were possible with HTML/javascript, you wouldn't see so many sites (like GMail) going out of their way to use flash or Java.

If you're stuck to HTML/Javasctipt, the next best thing you can do is the way GMail used to do it: put an "attach another file" link below the file selection input field, when the user clicks it another file selection input field is added to the page with javascript, so that they can add an unlimited number of files without navigating away from the page, but they still have to pick them one at a time.

Kip
+2  A: 

impossible Based on your data (users not having Flash) this is not possible with just HTML and Javascript. has alway been a huge debate whether to improve it or not. It doesn't even support too much CSS styling.

Multiple file uploads are able only via plugins. Either Flash, Java or Silverlight nowadays.

Robert Koritnik