tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Davison <>
Subject Re: Servlet File upload Oreily MultipartParser problems
Date Sat, 07 Jul 2001 16:15:48 GMT
I've got it to work on Linux but only using Tomcat stand-alone, not with

If I understand correctly, you are getting the input stream from the
request directly - "req.getInputStream()".

My understanding on how the MultipartParser works is that you instantiate 
a MultipartParser giving it the request, then iterate through the parts handling
the ParamParts one way and the FileParts another.  Something like:

MultipartParser mp = new MultipartParser(request, ...)
Part p = null;
while ((p = mp.readNextPart()) != null)
	if p is a paramPart ...
	else if p is a filePart
		FilePart fp = (FilePart) p;
		InputStream is = fp.getInputStream();

So each FilePart has it's own inputStream.

Not sure what the "Y"s you are seeing mean, but the above works for me.

Thus spake "Randy Paries" <> on Sat, 7 Jul 2001 09:11:53 -0500:

RP> Hello,
RP> does anyone have the Oreily MultipartParser file upload working with Tomcat
RP> and apache on Linux.
RP> I have developed this upload servlet using Jbuilder 4 and Win2000. The
RP> servlet works with the Jbuilder debugger(tomcat 3.1) and jrun. But is does
RP> work when I push it to my production linux box.
RP> When I execute the form to upload the image on the linux box, the form just
RP> hangs.
RP> what is strange is that every time
RP> ServletInputStream in = req.getInputStream();
RP> is called I get a "Y" printed on the console.
RP> Do anyone have this working on the linux config?
RP> has anyone seen a similar problem?
RP> Thanks
RP> Randy

View raw message