nervgh/angular-file-upload — pull request #175 by fiote (2014-07-13 16:22:27+00:00)
Title: Update angular-file-update.js to overwrite inputs

(this is my first fork, sorry if i'm doing it wrong)

Right now, when you click the input and select a file, AFU (angular-file-upload) adds the file to its queue list. If you then change the value in this same input, AFU will add the new file, but it will NOT remove the old value. Like, the user changed his mind about what file to upload, but AFU will still upload both.

That may not be the desired effect (it isn't in my project).

What I'm proposing:

1) when you change the input value and AFU adds it to its queue list, let's store that input in the filelist (lines 84/85).

2) we will need an option to act on it, so line 116 got "overwriteInputs" (0 as default, so it won't change current implementations).

3) when adding itens to the queue, we'll check if that input is already in use somewhere on the queue. If it is, we'll remove those (since we're inserting the current input value now). That's on lines 207-225.