I try to upload a file with a size greater than 128kb but I always get (Grails 4)
org.apache.tomcat.util.http.fileupload.impl.SizeLimitExceededException: the request was rejected because its size (1474589) exceeds the configured maximum (128000)
I already tried:
my application.yml:
controllers:
defaultScope: singleton
upload:
maxFileSize: 26214400
maxRequestSize: 26214400
My CustomMultipartResolver:
class CustomMultipartResolver extends StandardServletMultipartResolver {
static final String FILE_SIZE_EXCEEDED_ERROR = "fileSizeExceeded";
@Override
MultipartHttpServletRequest resolveMultipart(HttpServletRequest request) throws MultipartException {
try {
return super.resolveMultipart(request);
} catch (MultipartException e) {
log.error(e.message)
request.setAttribute(FILE_SIZE_EXCEEDED_ERROR, true);
return new DefaultMultipartHttpServletRequest(request, new LinkedMultiValueMap<String, MultipartFile>(), new LinkedHashMap<String, String[]>(), new LinkedHashMap<String, String>());
}
}
}