Hi Volker, now it works ok. The only drawback is that user has to wait for the file to upload to get error message telling him that it was too big, but I guess there's no helping it.
Thanks for help, michael On 17/03/07, Volker Weber <[EMAIL PROTECTED]> wrote:
Hi Michał, try setting the limit to -1, this may help. tobago uses commons-fileupload and the max size is the maximum allowed size of the request. if a request exeeds this threshold the complete processing is interupted by this library. -1 sets this to unlimited. Regards, Volker 2007/3/17, Michał 'Gandalf' Stawicki <[EMAIL PROTECTED]>: > I have added tc:messages, I have set the hard limit to 10m, inside > tc:file tag I have <tc:validateFileItem maxSize="5242880" /> (5MB) but > I am still getting exception: > > 2007-03-17 19:53:01 > org.apache.myfaces.tobago.fileupload.FileUploadFacesContextFactoryImpl > getFacesContext > SEVERE: > javax.faces.FacesException: > org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException: > the request was rejected because its size (258792412) exceeds the > configured maximum (10485760) > > Just can't get it to work ;/ > > regards > michael > > On 17/03/07, Bernd Bohmann <[EMAIL PROTECTED]> wrote: > > Hello Michael, > > > > is a tc:messages tag on your page or popup? > > > > Regards > > > > Bernd > > > > Michał 'Gandalf' Stawicki wrote: > > > Hello Bernd, > > > > > > I was using filter, now I have switched to tobago-fileupload.jar as > > > you suggested. > > > > > > Now in my logs I'm getting: > > > > > > javax.faces.FacesException: > > > org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException: > > > the request was rejected because its size (258792409) exceeds the > > > configured maximum (69206016) > > > > > > if I try to upload too large file. > > > > > > So, I guess there is no nice way to simply get validation error if the > > > file size exceeds the one set in web.xml, am I right? I can just set > > > some large hard limit and set desired limit on tc:validateFileItem? Or > > > am I missing something? I can't use <error-page> for the exception, as > > > I have to stay with the form in which I have tc:file tag. > > > > > > Thanks for help, > > > michael > > > > > > On 17/03/07, Bernd Bohmann <[EMAIL PROTECTED]> wrote: > > >> Hello Michael, > > >> > > >> how do you configure fileupload in tobago? > > >> I assume the Filter. > > >> > > >> The prefered option is tobago-fileupload.jar. This jar generates the > > >> error messages inside the faces lifecycle. > > >> The filter throws an exception outside the faces lifecycle. > > >> Both filter or jar have a hard limit (See configuration options in faq). > > >> > > >> With the validator you can configure some other validation after the > > >> file is downloaded. > > >> > > >> Regards > > >> > > >> Bernd > > >> > > >> Michał 'Gandalf' Stawicki wrote: > > >> > Hello, > > >> > > > >> > When I try to upload too large file, I simply get an exception. Am I > > >> > missing something? I would like to stay on the same page / get some > > >> > validation error. On my JSP I have: > > >> > > > >> > <tc:file > > >> > > > >> value="#{clientManagedBean.newOrderControler.attachmentsController.fileItem}" > > >> > > >> > > > >> > tip="Wprowadź nazwe pliku" > > >> > id="fileAddBrowse"> > > >> > > > >> > <tc:validateFileItem maxSize="10485760" /> > > >> > > > >> > </tc:file> > > >> > > > >> > regards, > > >> > michael > > >> > > > >> > > > > > > > > > > > -- > [EMAIL PROTECTED] > http://stawicki.jasliska.pl > GG: 3691111 > JID: [EMAIL PROTECTED] >
-- [EMAIL PROTECTED] http://stawicki.jasliska.pl GG: 3691111 JID: [EMAIL PROTECTED]