Topic: How to detect when all potential files have been processed by plupload
I've set a file size limit of 10 MB with a plupload instance and I'd like to generate a single error message for any files being too large when a user selects multiple files.
I know I can generate an error for each oversized file individually, but I need to prompt the user with an alert and if they select many oversized files they would end up with a whole bunch of alerts popping up one after the other. So the solution seems to be to collect any oversized files that were selected and then report the errors one time after plupload is done processing potential files.
This seems to be a bit tricky. I've half solve the problem but can't figure out a way to deal with all cases. Consider these two use cases:
1. The user selects a number of files of which a subset are oversized. Each oversized file can be added to an array by code in my 'Error' callback. Then when the 'FilesAdded' callback is called I can check the length of the oversized files array and report that some of the files were too large and will not be uploaded. So I've taken care of this case.
2. The user selects one or more files and they are all oversized. In this case I can add each of the files to the oversized files array, but I can't seem to find a way to determine when plupload is done processing the potential files. The 'FilesAdded' callback never gets called as no files are actually added to the queue. Similarly the 'QueueChanged' callback does not get called. So I haven't been able to solve the problem for this use case.
So are there any publicly visible properties I can observe from within the 'Error' callback to determine when the last potential file has been processed from a user's selection?
I hope I've explained the problem clearly. Any help is appreciated.