I am trying to avoid same file being selected more than one time. I have seen posts and replies such as
but when multiple file is selected (not drag/drop but selection from file dialog) all those functions are failing. Mostly, they miss the duplicate item at index 0. I have tried many other ways but could not figure out a solid and reliable way to achieve this.
Please note that I am also handling the file removed event and do some external stuff there, and I either need to find a way for one the scenarios below:
* catch and cancel duplicates when file is selected (before uploading etc.), in which case I do not need the file removed handler (since file was not actually selected, it was cancelled)
* catch duplicates at files uploaded event, and remove them from file list, properly calling file removed event
When single file is selected, previously suggested functions work fine, but when 6-8 files selected, problems show up.