Yesterday, when I was looking at the latest release of Plupload (v2.0 beta), I found a wonderful playland of classes that had been factored out of the original Plupload library as a means to make Plupload more flexible. And, when I saw that they had added a way to programmatically add files to a Plupload instance, I got excited that I may finally be able to associate multiple dropzones with a single Plupload instance - something that I don't believe had been possible in the past.
With the recent updates, the Plupload authors have factored out the classes - FileDrop and FileInput - as a means to independently add drag-drop functionality and file selection functionality to a given DOM element. As the same time, they have also added the method, addFile(), to the Plupload instance. This addFile() method can accept instances of the mOxie.File object, which is exactly what the FileDrop and FileInput classes emit. Pretty freakin' sweet!
To try and wire several of these dropzones into a single Plupload instance, I have put together this demo (which builds on yesterday's image preview demo):
This demo has eight (8) peripheral dropzones. And, using the FileDrop and FileInput constructors, I am able to pipe the various file-selection events into the addFile() method on the main Plupload instance. This has some seriously awesome implications; like being able to have a persistent uploader that dynamically connects to transient dropzones and file inputs. Yo, the Plupload guys are killing it with this new release!
Want to use code from this post? Check out the license.