cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeroen Reijn <>
Subject [ExceptionHandling] Catching "Content length exceeds maximum upload size"
Date Thu, 10 Nov 2005 10:17:37 GMT
Hi guys,

I hope somebody can help me out.Here is the situation:

I have a Cform with a file upload widget.
When I submit the form with a file that is bigger then the max allowed file
size, it throws a nice "Content length exceeds maximum upload size" error.

I'm under the impression that I could use the ExceptionSelector to catch this error.

So this is what I did:

Define the selector in my sitemap:

<map:selector name="exception"
   <exception name="toolarge" class=""/>

I've put both matchers in a seperate pipeline with a handle-errors part:

<map:pipeline type="noncaching" internal-only="false">

   <map:match pattern="*.continue">
     <map:call continuation="{1}"/>

   <map:match pattern="actionsform/*/**">
     <map:call function="availableActionsCachingHandleForm">
       <map:parameter name="function" value="actionsform2xml"/>
       <map:parameter name="form-definition"
       <map:parameter name="resourceId" value="/{1}/{2}"/>

     <map:select type="exception">
       <map:when test="toolarge">
         <map:generate src="status.xml"/>
         <map:serialize type="xml"/>


But when I get the error nothing happens. The selector does not get triggered.
It returns the same error I got before. Any clues? Or is there a better way of
doing this?

Thanks in advance!

Jeroen Reijn

View raw message