You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Ben M. Dotte" <bd...@widen.com> on 2005/09/12 18:21:58 UTC

Upload File Size

Hi,
 
I am attempting to limit the file size for an Upload component using
Tapestry 4's new validation system. I wrote a custom validator that
works except when the file being uploaded is bigger than the limit
defined in MultipartDecoderImpl (10,000,000). When that limit is
exceeded, I get an ugly error page "HTTP ERROR: 500". It appears that
Tapestry attempts to upload the file before it even gets to my
validator. Ideally, I would like to set maxSize in MultipartDecoderImpl
to -1, which bypasses the commons FileUpload check and only uses my
validator. In Tapestry 3 it was possible to do this in your .application
file:
 
<extension name="org.apache.tapestry.multipart-decoder"
class="org.apache.tapestry.multipart.DefaultMultipartDecoder">
  <configure property-name="maxSize" type="double" value="-1"/>
  </extension>
 
So, my question is, what is the best way to do this in Tap4? Some
thoughts:
- Is Tapestry supposed to be uploading before validating the field
(maybe this is a bug)?
- MultipartDecoderImpl has maxSize set at 10,000,000 but no setter to
change this like DefaultMultipartDecoder had?
 
Many thanks for any thoughts/ideas!
 
Ben Dotte

Re: Upload File Size

Posted by The Chris Method <th...@gmail.com>.
http://issues.apache.org/jira/browse/TAPESTRY-368

On 9/12/05, Ben M. Dotte <bd...@widen.com> wrote:
> 
> Hi,
> 
> I am attempting to limit the file size for an Upload component using
> Tapestry 4's new validation system. I wrote a custom validator that
> works except when the file being uploaded is bigger than the limit
> defined in MultipartDecoderImpl (10,000,000). When that limit is
> exceeded, I get an ugly error page "HTTP ERROR: 500". It appears that
> Tapestry attempts to upload the file before it even gets to my
> validator. Ideally, I would like to set maxSize in MultipartDecoderImpl
> to -1, which bypasses the commons FileUpload check and only uses my
> validator. In Tapestry 3 it was possible to do this in your .application
> file:
> 
> <extension name="org.apache.tapestry.multipart-decoder"
> class="org.apache.tapestry.multipart.DefaultMultipartDecoder">
> <configure property-name="maxSize" type="double" value="-1"/>
> </extension>
> 
> So, my question is, what is the best way to do this in Tap4? Some
> thoughts:
> - Is Tapestry supposed to be uploading before validating the field
> (maybe this is a bug)?
> - MultipartDecoderImpl has maxSize set at 10,000,000 but no setter to
> change this like DefaultMultipartDecoder had?
> 
> Many thanks for any thoughts/ideas!
> 
> Ben Dotte
> 
>