vaadin/vaadin-upload

missing notification when the setMaxFileSize value exceeded?

poczenorbert opened this issue · 3 comments

Description

When selected a file to upload with a size greater than set by setMaxFileSize nothing happens

Expected outcome

Notification shown and/or a FailedEvent or FileRejectEvent generated

Actual outcome

Nothing happens.

Live Demo

Steps to reproduce

https://vaadin.com/start/latest/project-base
Vaadin Flow version 12.0.3 with productionMode=true
upload.setMaxFileSize(1);

Browsers Affected

  • [x ] Chrome
  • [x ] Firefox
  • [ x] IE 11
  • [x ] iOS Safari

Thanks for the issue. Can you provide is with a code example so it would be easier to investigate?

I have this issue just when the setMaxFileSize( ) is used and a file with greater size is selected for upload.
To reproduce start with vaadin starter project base and change the MainView class like this:

public MainView() { Button button = new Button("Click me", event -> Notification.show("Clicked!")); MemoryBuffer buffer = new MemoryBuffer(); Upload upload = new Upload(buffer); upload.setUploadButton(button); upload.setMaxFileSize(1); upload.addFailedListener(failedEvent -> { Notification notification = Notification.show("Upload failed."); }); upload.addSucceededListener(uploadEvent -> { Notification notification = Notification.show("Upload ok. fileName="+uploadEvent.getFileName()); }); add(upload); }

This issue was moved to vaadin/vaadin-upload-flow#107