tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: FileUploadBase$IOFileUploadException
Date Thu, 02 Sep 2010 19:58:33 GMT
Paul Szynol wrote:
> Chris, I agree.  "Exceeds threshold size" or something along those lines 
> would be a lot more helpful.
> Paul
I believe that you missed Konstantin's message, and that consequently you may have a false

sense of security and a false sense of having found the correct solution and a false sense

that the error message was inaccurate.

In, they show these settings :

// Set factory constraints


// Set overall request size constraint

 From this, and from your original message, I gather that the way it works is :

- FileUpload will first try to upload the whole request in memory (for performance).
But if the request size exceeds the value set by .setSizeThreshold() (or 1 MB by default),

it will instead create a temporary file on disk to store the request.
- when it starts doing this (writing to disk), it is going to create this temporary file 
in the directory indicated by .setRepository().  If this is not explicitly set, it will 
default to "/".

So what happened on your first iteration, was that when the size exceeded the default of 1

MB, it tried to create a temporary file in "/", and failed because Tomcat does not have 
permission to write there.  From there came the (accurate) error message.
Now that you have increased the .setSizeThreshold() size, it does not reach it anymore, so

it does not create a temporary file, so you do not see the message anymore.
But it is a false solution, because now you have potentially  very large files being 
loaded in memory, and when that limit will some day be exceeded, you will get the 
permissions message again.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message