MemoryBuffer receiver = new MemoryBuffer();
Upload upload = new Upload(receiver);
upload.setAcceptedFileTypes("text/csv");
upload.setMaxFileSize(1024);
When I try to upload a file that’s greater than 1024 bytes. I expect the Upload.addFailedListener to be called, but it doesn’t get called. Any ideas why and how to fix?
Or better still, how can I know that the file that was attempted to be uploaded doesn’t meet the requirement so I can show the correct prompt to a user
If it helps.
<vaadin.version>13.0.11</vaadin.version> Spring Boot Version <version>2.1.6.RELEASE</version>
upload.getElement().addEventListener("file-reject", event -> onFileRejected(upload.getMaxFileSize(), event)); But the event JsonObject is empty which is most likely due to a bug described below