Hi,
I’m faced with problem during file uploading. Used https://cookbook.vaadin.com/upload-image-to-file as an example. And all the time(when upload more than 1Mb file) keep getting “The field file exceeds its maximum permitted size of 1048576 bytes.”
setMaxFileSize seems does nothing.
upload = new Upload(this::receiveUpload);
upload.setMaxFiles(1);
upload.setMaxFileSize(100 * 1024 * 1024);
private OutputStream receiveUpload(…) {
…
File uploadedFile = File(contentPath, fileName);
return new FileOutputStream(uploadedFile);
…
}
And additional question. According to doc for Upload component: “However, the user should be informed upfront about any file upload restrictions. Limitations on the maximum number of files allowed, file size, and format should all be communicated clearly, to avoid exceptions as much as possible.”
Should I do this or component does it by itself ?
Using V23, flow, Spring.