You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Christian Egli <ch...@wyona.com> on 2003/07/03 14:59:45 UTC

Request parameter matcher, POST and enctype="multipart/form-data"

Hi all

I was trying to get the file upload in Lenya resurrected and stumbled
across the following problem:

The RequestParameterMatcher doesn't seem to match the request
parameters if they come with a multipart/form-data post request.

Is there a way to make the RequestParameterMatcher match these request
parameters?

Attached is a minimal test case


Re: Request parameter matcher, POST and enctype="multipart/form-data"

Posted by Christian Egli <ch...@wyona.com>.
Vadim Gritsenko <va...@verizon.net> writes:

> Christian Egli wrote:
> 
> >If you look at my minimal example I'm not even trying to upload a file
> >(for now). All I'm trying to do is to have the RequestParameterMatcher
> >match parameters that are passed in a POST with multipart/form-data
> >encoding.
> 
> Enable-uploads required to enable parsing of multipart/form-data
> requests. If uploads are not enabled, parser is not used, and
> parameters won't be available (CocoonServlet, line 989). Once they are
> enabled, it should work (unless there is a bug...)

Thanks Vadim, that was indeed the problem. It works now.

-- 
Christian Egli       christian.egli@wyona.com   +41 1 272 9161
                     Wyona AG, Hardstrasse 219, CH-8005 Zurich
Open Source CMS      http://www.wyona.org http://www.wyona.com 

Re: Request parameter matcher, POST and enctype="multipart/form-data"

Posted by Vadim Gritsenko <va...@verizon.net>.
Christian Egli wrote:

>Vadim Gritsenko <va...@verizon.net> writes:
>
>  
>
>>Christian Egli wrote:
>>
>>    
>>
>>>The RequestParameterMatcher doesn't seem to match the request
>>>parameters if they come with a multipart/form-data post request.
>>>
>>>Is there a way to make the RequestParameterMatcher match these request
>>>parameters?
>>>      
>>>
>
>  
>
>>Try enabling uploads first (see web.xml)
>>    
>>
>
>Thanks Vadim, but the RequestParameterMatcher returns no request
>parameters (<h:requestParameters/>) even with enable-uploads set to
>true.
>
>If you look at my minimal example I'm not even trying to upload a file
>(for now). All I'm trying to do is to have the RequestParameterMatcher
>match parameters that are passed in a POST with multipart/form-data
>encoding.
>

Enable-uploads required to enable parsing of multipart/form-data 
requests. If uploads are not enabled, parser is not used, and parameters 
won't be available (CocoonServlet, line 989). Once they are enabled, it 
should work (unless there is a bug...)

Vadim




Re: Request parameter matcher, POST and enctype="multipart/form-data"

Posted by Christian Egli <ch...@wyona.com>.
Vadim Gritsenko <va...@verizon.net> writes:

> Christian Egli wrote:
> 
> >The RequestParameterMatcher doesn't seem to match the request
> >parameters if they come with a multipart/form-data post request.
> >
> >Is there a way to make the RequestParameterMatcher match these request
> >parameters?

> Try enabling uploads first (see web.xml)

Thanks Vadim, but the RequestParameterMatcher returns no request
parameters (<h:requestParameters/>) even with enable-uploads set to
true.

If you look at my minimal example I'm not even trying to upload a file
(for now). All I'm trying to do is to have the RequestParameterMatcher
match parameters that are passed in a POST with multipart/form-data
encoding.

-- 
Christian Egli       christian.egli@wyona.com   +41 1 272 9161
                     Wyona AG, Hardstrasse 219, CH-8005 Zurich
Open Source CMS      http://www.wyona.org http://www.wyona.com 

Re: Request parameter matcher, POST and enctype="multipart/form-data"

Posted by Vadim Gritsenko <va...@verizon.net>.
Christian Egli wrote:

>Hi all
>
>I was trying to get the file upload in Lenya resurrected and stumbled
>across the following problem:
>
>The RequestParameterMatcher doesn't seem to match the request
>parameters if they come with a multipart/form-data post request.
>
>Is there a way to make the RequestParameterMatcher match these request
>parameters?
>  
>

Try enabling uploads first (see web.xml)

Vadim