Hi Otho,

FILESIZE_MAX does limit the uploading of file to a certain size, it throws
an exception 500,FileUploadBase$FileSizeLimitExceededException, but how to
catch this exception in code? seems to me it always dumps it to the browser,
any idea? thanks.

Angelo


Otho wrote:
> 
> I digged a bit deeper into the upload component. And thankfull it seems to
> be possible by contributing to ApplicationDefaults. For example:
> 
> public static void contributeApplicationDefaults(
> MappedConfiguration<String, String> configuration)
> {
>         // Contributions to ApplicationDefaults will override any
> contributions to
>         // FactoryDefaults (with the same key).
> 
>         ....
> 
> -->        configuration.add(UploadSymbols.REQUESTSIZE_MAX, "1000000");
> -->        configuration.add(UploadSymbols.FILESIZE_MAX, "500000");
> }
> 
> Anyways many thanks for the answer.
> 
> Regards,
> Otho
> 
> 2008/2/27 Howard Lewis Ship <[EMAIL PROTECTED]>:
> 
>> Not that I know of; it's not something you can do on the client side.
>> There is some configuration on the server side, but that may be too
>> late for you.
>>
>> On Mon, Feb 25, 2008 at 11:11 AM, Otho <[EMAIL PROTECTED]> wrote:
>> > Is there a way to restrict the size of uploaded files in the upload
>> >  component?
>> >
>> >  In a community app with avatar upload it would be possible for
>> malicious
>> >  users to hog the application by uploading very large images to provoke
>> out
>> >  of memory errors. Is there any way to configure upload to only accept
>> files
>> >  up to a certain size?
>> >
>> >  Regards,
>> >  Otho
>> >
>>
>>
>>
>> --
>> Howard M. Lewis Ship
>>
>> Creator Apache Tapestry and Apache HiveMind
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-T5--Is-there-a-way-to-restric-filesize-in-upload-component--tp15675363p19177363.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to