Vaadin Upload: remove File

Hello,

I use the component: https://vaadin.com/components/vaadin-upload/java-examples for multi uploads with MultiFileMemoryBuffer .
Vaaadin-Version: 14.2.1

I try to remove the file, when clicking the x - in the Upload ui, see screenshot.

How can I get the filename in my Java code?
I try to get something from the event

upload.getElement().addEventListener("file-abort", event1 -> { }

but I could not get the shadow Root or the file on which the x is clicked.

Can somebody help me to resolve this issue?
18456544.jpg

This is a bit problematic upload.getElement().getProperty("files") gives the current list of the files as json array. I would assume that you can find “abort = true” in the file which was removed from the list.

Tatu Lund:
This is a bit problematic upload.getElement().getProperty("files") gives the current list of the files as json array. I would assume that you can find “abort = true” in the file which was removed from the list.

The property doesn’t exist. Not in the file-abort not in the file-remove event either. Hmmm…

I tried to extend the Upload-class add the following in the MyUpload-constructor:

 public MyUpload(Receiver receiver) {
        super(receiver);

        final String elementFiles = "element.files";
        DomEventListener myListener = e -> {
            JsonArray files = e.getEventData().getArray(elementFiles);
          
            System.out.println("add event date");
        };

        getElement().addEventListener("file-remove",myListener).addEventData(elementFiles);

    }

Then, I get a json with the details of status for the file-remove/abort-Event:

{“loaded”:1365860,“held”:false,“status”:“”,“xhr”:{},“uploadTarget”:“VAADIN/dynamic/resource/0/31fe5531-eee3-486e-ae1b-dcf7e4a44074/upload”,“formDataName”:“file”,“indeterminate”:false,“uploading”:false,“error”:false,“abort”:false,“complete”:true,“progress”:100}

So far so good, but abort is false?? and I didn’t receive the filename from that.