Hi everyone I'm using Grails 4.0.12, and am sendi...
# questions
j
Hi everyone I'm using Grails 4.0.12, and am sending a cURL request to upload a file using the -F option If I don't use any header in the cURL request describing the content type, it goes to Error Controller which doesn't state anything regarding the exception (request.exception is null) But if I provide the content type, it does get to the intended controller action, but when I try to perform request. getFile() it gives me an error. The request is of type
org.springframework.security.web.servletapi.HttpServlet3RequestFactory$Servlet3SecurityContextHolderAwareRequestWrapper
Strangely, this cURL request works fine with Grails 2.5.4, where the request is automatically treated as a MultipartHTTPServletRequest Any idea what I could be going wrong over here?
I even tried to get the MultipartHTTPServletRequest by unwrapping the request, but it never showed any MultipartHTTPServletRequest
It's working fine now
Initially there was some logging issue due to which the request used to go directly to ErrorController
but there was no stacktrace
after the logging issue was fixed, the stacktrace came up and it showed issue pertaining to file upload size limits
On setting the following parameters:
Copy code
grails.controllers.upload.maxFileSize
grails.controllers.upload.maxRequestSize
The issue got resolved and file was uploaded successfully, There's no need of sending the content type header as part of request
Just put this info here in case someone else runs down to similar issue