tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Laffey <>
Subject Re: can jsp handle multipart/form-data ?
Date Tue, 12 Dec 2000 16:08:51 GMT
On Tue, 12 Dec 2000, John D. Smith wrote:

> I try to make a jsp page that handles a file upload.
> The problem i face is that i get a Internal Server Error from apache
> when i submit <FORM enctype="multipart/form-data" ...> to a jsp as action.
> Sending the same to php / cgi works fine.
> Question is: Is my server(apache/tomcat) misconfigured or doesn't jsp
> handle that kind of requests ?

Here's what I discovered about this issue:

I am using the multipart classes from Jason Hunter (with Java Servlet
Programming from O'Reilly... I am using the latest version from the
website.) The problem is that if you use a multi-part request, but then do
not treat it as such (by reading the ServletInputStream) then you will get
the INternal Error. I found that the Multipart classes do not read the
input stream if the file is too large (i.e. the check for the larger file
is done before the reading of the entire stream). This is a good idea in
general, but leads to the error. I am working on some enhancements to the
multipart classes that fix this. I have a working version now, but it is
not too generic . (i.e. it has been hacked quickly to work with my
project.) I can share this... If you are insterested let me know.

Joe Laffey
LAFFEY Computer Imaging
St. Louis, MO
With no walls or fences on the Internet, who needs Windows or Gates?

View raw message