It's much easier to simply say "keep all", and it simplifies the code quite a bit.
Attach a file by drag & drop or click to upload