Closed Artur- closed 5 years ago
Hello, I'm encountering the same issue with all three (Started/Finished/Succeeded) Listeners. They are not called when an upload is being submitted. I am currently using the Started/Finished Listeners to verify an image upload is being made and a Succeeded Listener to return a preview of the image.
It also appears that the MemoryBuffer, even though set to the Upload when initialized, is returning a null/empty value.
MemoryBuffer buffer = new MemoryBuffer();
Upload imgUpload = new Upload(buffer);
...
imgUpload.addStartedListener(e -> {
System.out.println("Handling upload of " + e.getFileName() + " (" + e.getContentLength() + " bytes) started");
});
imgUpload.addFinishedListener(e -> {
System.out.println("Handling upload of " + e.getFileName() + " (" + e.getContentLength() + " bytes) finished");
});
imgUpload.addSucceededListener(e -> {
System.out.println("Succeeded Upload of " + e.getFileName());
//use the MemoryBuffer to stream preview
try {
System.out.println("----Upload Primary Image");
System.out.println(buffer.getFileData().getMimeType());
BufferedImage img = ImageIO.read(buffer.getInputStream());
showDbImage(img);
} catch (IOException ex) {
_MainUI.getApi().logError(ex);
}
});
It seems like in StreamReceiverHandler::doHandleMultipartFileUpload
, line 178 the upload iterator that is returned from getItemIterator
is actually empty.
I also want to confirm that this is still an issue in 13.0.0.alpha1
how to fix that on vaadin10.0.11 ?
can you release a vaadin10.0.12 with the fix please ?
Only prints
started
messages and neverfinished
messages