You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by oceatoon <t....@systheo.com> on 2005/04/06 14:43:20 UTC

Cforms upload validation?

Hi every one 

My Form contains upload widgets, 
I have limited the size parameter in web.xml upload config.

But I would like to get the oversized error as a form validation error.
In the Form validation docs, it says upload widget supports validation but
no idea of which rules.

Is there a sample for this? a link ?
While digging the net I haven't found anything.
Thanks for the hints
Regards
Tibor




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Cforms upload validation?

Posted by oceatoon <t....@systheo.com>.
The discussion is in dev then.
Thanks
> oceatoon wrote:
> 
>>Hi every one
>>
>>My Form contains upload widgets,
>>I have limited the size parameter in web.xml upload config.
>>
>>But I would like to get the oversized error as a form validation error.
>>In the Form validation docs, it says upload widget supports validation but
>>no idea of which rules.
>>  
>>
> 
> There are no built-in validators for the upload widget except the
> mime-type checks. You can however plug an custom validator to check e.g.
> the content of the uploaded file.
> 
> However, your problem is different and cannot be handled with the
> current CForms, and worse, with the current Cocoon as oversized upload
> is filtered very early in the request processing, i.e. in the
> CocoonServlet.
> 
> What that means is that the upload widget has no means to know that
> upload has occured but was rejected. We need for this to enhance the
> multipart handling to pass an indication of the rejected upload to the
> application. Note that such indication would be useful also to detect
> that upload isn't enabled in web.xml.
> 
> Please file a bug for this.
> 
> Sylvain
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Cforms upload validation?

Posted by Sylvain Wallez <sy...@apache.org>.
oceatoon wrote:

>Hi every one 
>
>My Form contains upload widgets, 
>I have limited the size parameter in web.xml upload config.
>
>But I would like to get the oversized error as a form validation error.
>In the Form validation docs, it says upload widget supports validation but
>no idea of which rules.
>  
>

There are no built-in validators for the upload widget except the 
mime-type checks. You can however plug an custom validator to check e.g. 
the content of the uploaded file.

However, your problem is different and cannot be handled with the 
current CForms, and worse, with the current Cocoon as oversized upload 
is filtered very early in the request processing, i.e. in the CocoonServlet.

What that means is that the upload widget has no means to know that 
upload has occured but was rejected. We need for this to enhance the 
multipart handling to pass an indication of the rejected upload to the 
application. Note that such indication would be useful also to detect 
that upload isn't enabled in web.xml.

Please file a bug for this.

Sylvain

-- 
Sylvain Wallez                        Anyware Technologies
http://apache.org/~sylvain            http://anyware-tech.com
Apache Software Foundation Member     Research & Technology Director


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org