Hi,
I'm using the class MultipartRequest from servlets.com to upload files
in my web application. I've noticed a strange behaviour when using
this class.
Apparently, you CAN NOT call getParameter() from the request-object before
creating an instance of MultipartRequest. Doing so will result in this
exception:
java.io.IOException: Corrupt form data: premature ending at
com.oreilly.servlet.MultipartRequest.readRequest(MultipartRequest.java:356)
at com.oreilly.servlet.MultipartRequest.<init>(MultipartRequest.java:149)
...
...
This is a problem for me, because I use an "entry-servlet" which gets all
request. This servlet reads a parameter to determine what to do. So,
in my doGet()- and doPost()-methods (doPost actually just calls doGet) I
read this parameter. This worked fine until I started to write my uploading
-routines.
My work-around so far is to get the raw querystring from the request-object
via
getQueryString (this doesn't seem to brake MultipartRequest) and then
manually
parse the data.
Somehow, getParameter() must have modified the request-data which confuses
MultipartRequest. I'm using Resin as my servlet engine, version 1.2.0.
So, my question is, has anyone else experiences this behaviour? What was
your
work-around?
[ Matthias Carlsson ]
[ Programmer (Java, XML/XSL, CGI/Perl, HTML/JS) ] [ Web Designer ]
[ E-Mail : [EMAIL PROTECTED] ] [ ICQ: 1430647 ]
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html