Closed LaiZhou closed 5 years ago
when upgrade to 12.0.0,the upload component can't listen the event. code:
MultiFileMemoryBuffer buffer = new MultiFileMemoryBuffer(); upload.setReceiver(buffer); upload.setAcceptedFileTypes("image/jpeg", "image/png", "image/gif", "image/jpg"); upload.addSucceededListener(event -> { try { String imgName = MD5Util.md5(UUID.randomUUID().toString()) + "." + event.getFileName().split("\\.")[1]; FileUtils.writeByteArrayToFile(new File("/statics/imgs/" + imgName), IOUtils.toByteArray(buffer.getInputStream(event.getFileName()))); getModel().getImgs().add(imgName); } catch (Exception e) { getLogger().error("upload error", e); showNotification("图片保存失败:"+e.getMessage(),true); } });
This issue was moved to vaadin/vaadin-upload-flow#104
when upgrade to 12.0.0,the upload component can't listen the event. code: