You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "John D. Smith" <ra...@my-deja.com> on 2000/12/12 15:51:06 UTC

can jsp handle multipart/form-data ?

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 ?

Regards

John



------------------------------------------------------------
--== Sent via Deja.com http://www.deja.com/ ==--
Before you buy.



Re: can jsp handle multipart/form-data ?

Posted by Joe Laffey <jo...@laffeycomputer.com>.
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?
---------------------------------------------------------------------