File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes com.oreilly.servlet  MultipartRequest weirdness Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "com.oreilly.servlet  MultipartRequest weirdness" Watch "com.oreilly.servlet  MultipartRequest weirdness" New topic
Author

com.oreilly.servlet MultipartRequest weirdness

Paul Wetzel
Ranch Hand

Joined: Nov 02, 1999
Posts: 107
Is anyone out there experiencing any weirdness when using the above stated package/class. When i upload a file that is larger than what maxSize (MultipartRequest.maxSize) I am dead in the water. Netscape will even throw up a error dialog box stating that a network error occured while sending data: connection aborted. I am catching the IOEception but somoething else is happening (to the request object?) that I cannot figure out.
any insight on this would be greatly appreciated
pjw
Paul Wetzel
Ranch Hand

Joined: Nov 02, 1999
Posts: 107
I found the answer on suns dev con. the call to request.getContentLength() was the root of the evil. I am not sure why this call was screwing things up but the solution is:
if the value returned by request.getContentLength() is to big you need to get the servlet input stream and "flush" it like this

where theLength is the value from
then you can use the request object w/ no weirdness
[This message has been edited by Paul Wetzel (edited September 18, 2000).]
akshay mahajan
Greenhorn

Joined: Jan 18, 2001
Posts: 10
can i use oreilly in JSP if yes how
help sorted
mail me at akshaymahajan@hotmail.com
 
Consider Paul's rocket mass heater.
 
subject: com.oreilly.servlet MultipartRequest weirdness