Reply To: File Upload not working with Join
The problem is that, according to the Servlet spec, you are only allowed to call request.getParamater*() from servlets that have been configured to work with multipart requests. You can mark a servlet as “multipart”-capable using
@MultipartConfig or with your web.xml.
Now the real problem is, that Rewrite needs to call
request.getParamater*() from a filter. According to the spec, this is not specified. The spec doesn’t forbid it, it just don’t mentions what should happen in this case.
I don’t remember all the details, but AFAIK the request parameter map is empty in this case (at least for Tomcat without setting allowCasualMultipartParsing to true) which basically breaks Rewrite. As many JEE containers are using Tomcat internally, this may also be the case there.
So as Rewrite is based on a Servlet filter and accessing certain request properties from a filter isn’t specified for multipart requests, you run into these problems.
I know this is not very satisfying, but there is not much we can do about this. Setting
allowCasualMultipartParsing is definitely a way to fix this issue for Tomcat. And my guess is that this also works for other containers which are based on Tomcat.