cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jorg Heymans>
Subject Re: [cForms] Weird behaviour with enctype="multipart/form-data" and enable-uploads=false
Date Mon, 07 Feb 2005 08:23:36 GMT

Reinhard Poetz wrote:
> Today I've noticed a weird behaviour when you set 
> enctype="multipart/form-data" and forget to set the "enable-uploads" 
> parameter in web.xml. The result is that all data that come with the 
> request are lost and therefore not displayed any more.
> I would have expected some kind of exception like "you can't use 
> enctype='multipart/form-data' if you don't set the parameter 
> 'enable-uploads' in your web.xml to true. This would have helped me to 
> save some time.

I got stung by this as well once. I actually expected the uploads to be 
discarded but my form parameters to go through - that isn't how it works 

I don't understand how loses the formparameters in 
the first place, all it does is (around line 1020)

             if (this.enableUploads) {
                 request = requestFactory.getServletRequest(req);
             } else {
                 request = req;

but maybe I didn't dig deep enough ...

> WDOT? Are there valid usecases of a set "enctype='multipart/form-data'" 
> and enable-uploads=false in Cocoon Forms?
I can't think of any, but if it is HTML-legal to set 
enctype='multipart/form-data' and *not* upload any files (or not even 
define any <input type="file"> fields) then cocoon should support this.

Jorg (who has a vague deja-vu feeling about this thread)

View raw message