Hi Tim,

thanks for raising this, I did wrap the whole thing like so:


    LiftRules.maxMimeSize = 6 * 1024 * 1024
    LiftRules.maxMimeFileSize = 5 * 1024 * 1024

    LiftRules.handleMimeFile = (fieldName, contentType, fileName,
inputStream) =>  {
      try {
        OnDiskFileParamHolder(fieldName, contentType, fileName,
inputStream)
      }
      catch {
        case e:Exception =>
          S.error("Failure in upload (file too large?). Details: " +
e.toString)
          new InMemFileParamHolder("", "", "", null)
        case _ => new InMemFileParamHolder("", "", "", null)
      }
    }

and now I remember that I did manage to catch an exception once when I
set the maxMimeFileSize to very low. Then I set it back to where it
was and tested with a 7MB file.
I think I understand now: The above will catch based on
maxMimeFileSize. It will not work when the file you upload also
exceeds the maxMimeSize, which is when you get the stack trace at the
beginning of my post.

So I suppose the solution is to set the maxMimeSize to "Infinity".

Marius, thanks for the hint. Was just a quick idea how to keep face
with users in such a case, since I'm running on a virtual server, but
it's clear such conditions should really be avoided by proper
configuration and load testing.

Best wishes, Tim


--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.


Reply via email to