avocode/FormExtensions — pull request #80 by sescandell (2013-11-13 22:54:52+00:00)
Title: [WIP] Fix issue #59

This PR fix issue #59 in a "simple way".

On commit df27da06cab85bb04ceb41a479c7d9660ba06880 we allow to click multiple times on the add button making the file list growing automatically (and on save, all files are correctly uploaded). On a click on the main cancel button, all "wating for upload" file are removed. This works fine.
*Avantages*: we can select multiple files from multiple directories in one simple upload
*Drawbacks*: if we click only on cancel button of one file from the list of "waiting for upload", entry in the table presentation will effectively be removed. But the file will still be uploaded on form submission. This is because FileList associated to the input could not be modified in order to remove an item (`files` property is a readonly one).

So I made the commit 04254075f1d06253e0b7cf8f2bd3f7a69fdd885c in order to implement what @satiricon proposed in #28344375 : for each click on the "add files" button with new files selected, we simply remove all previously "waiting for upload" files.
*Advantages*: no "fantom" upload
*Drawbacks*: we can only add files from the same directory at a time. "Fantom" upload too...

All of this is only concern synchronous upload.

To prevent "fantom upload" I see two possibilities:
- it doesn't matter (and we have no perfect solution because of HTML5 restrictions) and mark this behavior as "known" but cannot be handle by our side ;
- I have a solution to make validation on server side, but the file will still be uploaded... just not linked to the entity ;
- on a click on "cancel button" from a file entry, we also cancel all files from the same "selection". This could be weird from a user... But it prevents from fantom uploads ;

@loostro , @satiricon what do you think? For you, what's the best behavior?