Upload MultiFile - remove one file (Solved)

Hi! How can I find out on the server side (java) which file was removed on the client side from the file list (when the user clicked on the X remove button)?
I tried to use the upload.addEventListener(“file-remove”, e → removeFile(e)) but I couldn’t find the filename…

I use MultiMemoryBuffer and when I call the multiMemoryBuffer.getFiles() in the removeFile method (my custom method see above) it returns the whole set (it still contains the remove file in the set).

There was a workaround posted some years ago by Leif, not sure if it still works https://github.com/vaadin/flow-components/issues/1342#issuecomment-516292999

Ohh thanks. The following did the trick :slightly_smiling_face:

  JsonObject eventData = event.getEventData();
  System.out.println("Removed " + eventData.getString("event.detail.file.name"));

I didn’t know there is an addEventData() :slightly_smiling_face:

Upload MultiFile - remove one file (Solved)