Announcement Announcement Module
Collapse
No announcement yet.
Avoid MultipartException with CommonsMultipartResolver? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Avoid MultipartException with CommonsMultipartResolver?

    Hello,

    I've configured the org.springframework.web.multipart.commons.CommonsM ultipartResolver to resolve all my multipart/form-data requests of my webapp.

    From time to time, I get a

    org.springframework.web.multipart.MultipartExcepti on: Could not parse multipart request

    exeption in my logfile, which is rooted by a

    org.apache.commons.fileupload.FileUploadBase$Unkno wnSizeException: the request was rejected because it's size is unknown

    exception. These exception seem to be caused by out-dated clients (namely Internet Explorer 5.0 or older) that do not seem to support the content-length header properly.

    Unfortunately, I do not need the file upload facility at all right now, I only use multipart for transmitting full unicode form parameters.

    So my question is, can I avoid these exceptions somehow, even for the older clients? The resolver need not check the content-length header.

    I'm using Spring 1.1, Commons FileUpload 1.0, JDK 1.4.2_05 and Tomcat 5.0.27.

    Regards,

    Andreas

  • #2
    Code:
    260  if (requestSize == -1)
    261  {
    262    throw new UnknownSizeException(
    263      "the request was rejected because it's size is unknown");
    264  }
    From org.apache.commons.fileupload.FileUploadBase

    There's no conditional checking for the request size, so I guess it'll be difficult to solve this one. Maybe you can ask at the commons fileupload list to see if they've encountered this problem more often.

    cheers,

    Alef

    Comment


    • #3
      For the time being, you could switch to CosMultipartResolver as alternative. Drop cos.jar into your WEB-INF/lib directory, and don't forget to buy a copy of the latest version of Jason Hunter's Servlet book ;-) (which is required by COS' license)

      Juergen

      Comment


      • #4
        Thanks for your answers. I have posted a question on the jakarta commons mailing list.

        Comment


        • #5
          Solution

          I've also ran into this problem.
          In response to Andreas' post there was a reply on the commons upload list
          saying that the bug was fixed and (at that time) was in the nightly builds.

          This is the original reply:

          http://www.newsarch.com/archive/mail.../msg03173.html

          Comment

          Working...
          X