----- Original Message ----- From: "Michele Fuortes" <[EMAIL PROTECTED]>
To: <users@tomcat.apache.org>
Sent: Thursday, August 07, 2008 8:18 PM
Subject: Problem with POST to servlet: 16384 bytes maximum?


Hi,

I have a problem with POSTing an XML file to a servlet which writes the XML to disk. If the XML file is less than 16384 bytes all goes well. If it's bigger the first 16384 bytes are written correctly, the rest all all 00s. The lenght of the file is the correct one as in the Content-Length: http header.

The servlet is very simple (I did not write it), the relevant parts are:

File file;
FileOutputStream out2;
DataOutputStream out3;
......
file = new File(req.getRealPath(filePath));
out2 = new FileOutputStream(file);
out3 = new DataOutputStream(out2);
......
bytesAvailable=req.getContentLength();
byte[] theBytes=new byte[bytesAvailable];
in.read(theBytes);
out3.write(theBytes,0,bytesAvailable);
out3.flush();
....

Can anyone help? Is there a buffer limit somewhere that I have to  change.
I'm using Apache 2.063/Tomcat/4.1.29-LE-jdk14 on MacOS 10.5.3

Thanks

Michele Fuortes


--
Michele Fuortes, M.D., Ph.D.
Assistant Professor
Department of Cell and Developmental Biology
Cornell University  - Weill Medical College
E-mail: [EMAIL PROTECTED]

Michele... check this out... the default POST size is actually much larger... I suspect it may be an encoding problem.... whatever is sending that file must also encode it correctly...
If you try a diff XML file and this size changes.... its the issue.
Long time since I messed with this stuff... but I dont think a raw XML file will post... XML is full of little gremlins that mean something to a url decoder if not encoded ;)

http://tomcat.apache.org/tomcat-5.5-doc/config/http.html

Other possibility is theres a funny with the https... try do a normal http just to elim that as well..

Good luck...

---------------------------------------------------------------------------
HARBOR : http://www.kewlstuff.co.za/index.htm
The most powerful application server on earth.
The only real POJO Application Server.
See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm
---------------------------------------------------------------------------

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to