I am given this error when trying to upload an image. I was hoping someone else has gotten this error and knows a solution. I am using the current vaadin 8. I have added Listeners to see if the Upload has started or failed and neither actually run. I have blacked out part of the image for privacy concerns.
I did a really quick and dirty test, which seems to work:
[code]
ByteArrayOutputStream baos = new ByteArrayOutputStream();
Upload upload = new Upload("Upload THIS", new Upload.Receiver() {
@Override
public OutputStream receiveUpload(String s, String s1) {
try {
baos.write(s1.getBytes());
} catch (IOException e) {
e.printStackTrace();
}
return baos;
}
});
Button button = new Button("Print uploaded file");
button.addClickListener(event -> {
Notification.show(new String(baos.toByteArray()));
});
[/code]