I don’t know about any workarounds for this issue which work on Glassfish. Sorry.
As described in the FAQ, there is really no way for Rewrite to work around this issue. Rewrite has to use methods like HttpServletRequest.getParameter() which breaks multipart requests in some containers.
AFAIK the Tomcat workaround doesn’t work in Glassfish (although Glassfish uses Tomcat internally, right?). Wildfly in the newest version should work. Older versions have to be patched.
One thing that COULD work in Glassfish is to create a rule that basically prevents that other Rewrite rules are evaluated for the URL that contains the upload component. So you could try to add this in front of all your other rules: