Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Donate Today!

Do you enjoy these
technical forums?
Donate Today! Click Here

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Upload timeout configuration

stefanica (Programmer)
11 Aug 03 7:40
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="org.apache.coyote.tomcat4.CoyoteConnector"
port="8080"               minProcessors="5" maxProcessors="75"
               enableLookups="true" redirectPort="8443"
               acceptCount="100" debug="0" connectionTimeout="20000"
               useURIValidationHack="false" disableUploadTimeout="true" />
    <!-- Note : To disable connection timeouts, set connectionTimeout value
     to -1 -->


with disableUploadTimeout="true" and connectionTimeout="200", 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
williamcoates (Programmer)
9 Oct 03 7:19
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...
williamcoates (Programmer)
10 Oct 03 5:30
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.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close