You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Alan P Sexton <A....@cs.bham.ac.uk> on 2002/11/04 06:36:39 UTC

What gives with file upload when it exceeds maxFileSize?

I have seen a number of questions around this topic in the archives but
no clear answers:

First everything works fine when I upload a file below the limit (set in
the controller element in struts-config.xml)

Problem occurs when I upload a file that is too big: My form bean is
very simple and just contains a FormFile. I have no validation on for
this action.

When I get into the Action, the formbean is there but the FormFile
property in the bean returns null (okay so far). I happily dump some
messages to the log before returning to mapping.findForward("cancel")
which is a forward to my main menu (which works perfectly if the file
was below the limit) and I can see that
org.apache.struts.MaxLengthExceeded has been set to true in the request
context

In mozilla 0.9.2.1, I get to a blank screen.

In IE 6.0 it gives me a "The page cannot be displayed. The page you are
looking for is currently unavailable."

BUT: on netscape navigator 4.7, it works fine!!!!

There are no exceptions in the log files or any other indication of what
went wrong.

I assume that the Mozilla and IE are complaining about the server
refusing to accept the file (although from the archives, I thought the
server couldn't do this). If so, how can you cleanly handle an error of
this type and give the user a nice error message?

Alan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>