我正在尝试在 Vaadin 14.4.2 中上传文件
MemoryBuffer loadWeightsBuffer = new MemoryBuffer();
Upload loadWeightsButton = new Upload(loadWeightsBuffer);
loadWeightsButton.setMaxFiles(1);
loadWeightsButton.setDropLabel(new Label("Load weights"));
loadWeightsButton.setMaxFileSize(500000000);
loadWeightsButton.addFileRejectedListener(event -> {
writeToTerminal(event.getErrorMessage());
});
loadWeightsButton.addSucceededListener(event -> {
saveFile(event.getMIMEType(), event.getFileName(), loadWeightsBuffer, WEIGHTS);
});
但是当我上传到大文件时出现此错误。
org.apache.tomcat.util.http.fileupload.impl.SizeLimitExceededException: the request was rejected because its size (44948839) exceeds the configured maximum (10485760)
我试图添加它application.properties
但没有成功。如何增加 Vaadin 中的上传大小?
spring.http.multipart.max-file-size=500MB
spring.http.multipart.max-request-size=500MB