Grails3 file upload maxFileSize limit

Grails 3, Grails 4 and Grails 5 The solution is to set maxFileSize and maxRequestSize limits inside your application.yml file (usually placed inside grails-app/conf/). Be sure to have something like this: grails: controllers: upload: maxFileSize: 2000000 maxRequestSize: 2000000 Replace 2000000 with the number of max bytes you want for a file upload and for the … Read more

Accessing the raw body of a PUT or POST request

It is possible by overriding the HttpServletRequest in a Servlet Filter. You need to implement a HttpServletRequestWrapper that stores the request body: src/java/grails/util/http/MultiReadHttpServletRequest.java package grails.util.http; import org.apache.commons.io.IOUtils; import javax.servlet.http.HttpServletRequestWrapper; import javax.servlet.http.HttpServletRequest; import javax.servlet.ServletInputStream; import java.io.*; import java.util.concurrent.atomic.AtomicBoolean; public class MultiReadHttpServletRequest extends HttpServletRequestWrapper { private byte[] body; public MultiReadHttpServletRequest(HttpServletRequest httpServletRequest) { super(httpServletRequest); // Read the request … Read more

Grails unable to install plugin

The repository changed and it’s causing problem for older Grails versions. See my answer at: Grails Url shortener plugin not getting installed : Please use mavenRepo “https://repo.grails.org/grails/plugins” As a repository definition. http://grails.1312388.n4.nabble.com/Grails-central-repo-seemingly-missing-plugin-versions-td4658720.html