Hi Magnus,

I ran into this recently too... It might help if you understand the relevant part of Cocoon's request processing...

1. By default all requests are passed through the servlet filter org.apache.cocoon.servlet.multipart.MultipartFilter.

2. MultipartFilter calls org.apache.cocoon.servlet.multipart.RequestFactory

3. If the request is of type multipart/form-data, RequestFactory uses org.apache.cocoon.servlet.multipart.MultipartParser to parse the request into a org.apache.cocoon.servlet.multipart.MultipartHttpServletRequest

4. MultipartHttpServletRequest or HttpServletRequest is passed up the filter chain.

The MultipartHttpServletRequest that is created provides direct access to the uploaded Parts as if they were request parameters, usually negating the need for commons-fileupload.

I've never done it myself, but I guess if you wanted to handle the request directly you could try removing the MultipartFilter configuration from your web.xml.

Hope this helps,

Robin




at org.apache.cocoon.servlet.multipart.RequestFactory.getServletRequest to see how uploaded files are parsed automatically by Cocoon

On 15 Jul 2008, at 12:08, Magnus Haraldsen Amundsen wrote:

Hi,

I want to use commons-fileupload to handle fileupload in my webapp. I’ve followed the tutorial at http://commons.apache.org/fileupload/ using.html but line

List /* FileItem */ items = upload.parseRequest (request.getCocoonRequest());

always gives me an empty list. items.size() == 0.

I suspect that this is because the HttpServletRequest is already parsed somewhere within Cocoon. Is there a workaround for this problem?

-Magnus



IMPORTANT NOTICE: This message may contain confidential information. If you have received this e-mail in error, do not use, copy or distribute it. Do not open any attachments. Delete it immediately from your system and notify the sender promptly by e- mail that you have done so. Thank you.


Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to