Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Upload timeout configuration 1

Status
Not open for further replies.

stefanica

Programmer
Aug 11, 2003
4
RO
Hi,

I'm using Tomcat as a servlet container for an application. I have to handle some file uploads. In the real context the aplication returns some errors sometimes, when somebody try to upload a big file :


19532165 [Thread-28] ERROR org.apache.struts.upload.CommonsMultipartRequestHandler - Failed to parse multipart request
org.apache.commons.fileupload.FileUploadException: Processing of multipart/form-data request failed. Read timed out
at org.apache.commons.fileupload.FileUpload.parseRequest(FileUpload.java:519)
at org.apache.commons.fileupload.FileUpload.parseRequest(FileUpload.java:355)
at org.apache.struts.upload.CommonsMultipartRequestHandler.handleRequest(CommonsMultipartRequestHandler.java:233)
at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1055)
.......................
.......................



The problem is I can't reproduce the error on my compter.
I've tried to find out where can I set Tomcat to wait a short time, but I haven't seen anything. I've tried to change in server.xml file in section :


<Connector className=&quot;org.apache.coyote.tomcat4.CoyoteConnector&quot;
port=&quot;8080&quot; minProcessors=&quot;5&quot; maxProcessors=&quot;75&quot;
enableLookups=&quot;true&quot; redirectPort=&quot;8443&quot;
acceptCount=&quot;100&quot; debug=&quot;0&quot; connectionTimeout=&quot;20000&quot;
useURIValidationHack=&quot;false&quot; disableUploadTimeout=&quot;true&quot; />
<!-- Note : To disable connection timeouts, set connectionTimeout value
to -1 -->


with disableUploadTimeout=&quot;true&quot; and connectionTimeout=&quot;200&quot;, but I didn't get the error.


Can somebody tell me where can I set the timeout for a FileUpload. I need an example please.


Thanks
Stefan
 
I have also got similar problems to this... did you manage to find a solution?

I found that adding a call to FormFile.destroy() after the file uploaded helped a little... now if there is only one upload at a time the thing seems to work. However, if two people upload at the same time, only the first upload appears to succeed.

It seems that the tempory file handling is somehow causing problems, but I don't know why...
 
Ignore my last post... I have found the solution.

To ensure you don't get read timeouts on file uploads, you must set attribute disableUploadTimeout to false.

This seems kind of back to front, but if disableUploadTimeout is true, it will not give uploads a longer timeout, thus causing read timeouts.

You probably did not see this at home if perhaps you were testing on a LAN, or if you have a fast connection perhaps.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top