Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 10663 invoked from network); 22 Jul 2008 17:38:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Jul 2008 17:38:41 -0000 Received: (qmail 76281 invoked by uid 500); 22 Jul 2008 17:38:36 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 76249 invoked by uid 500); 22 Jul 2008 17:38:36 -0000 Mailing-List: contact users-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: users@cocoon.apache.org List-Id: Delivered-To: mailing list users@cocoon.apache.org Received: (qmail 76237 invoked by uid 99); 22 Jul 2008 17:38:36 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Jul 2008 10:38:36 -0700 X-ASF-Spam-Status: No, hits=2.3 required=10.0 tests=DATE_IN_PAST_96_XX,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of joerg.heinicke@gmx.de designates 213.165.64.20 as permitted sender) Received: from [213.165.64.20] (HELO mail.gmx.net) (213.165.64.20) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 22 Jul 2008 17:37:41 +0000 Received: (qmail invoked by alias); 22 Jul 2008 17:38:04 -0000 Received: from pd907f266.dip0.t-ipconnect.de (EHLO joerg-heinickes-computer.local) [217.7.242.102] by mail.gmx.net (mp056) with SMTP; 22 Jul 2008 19:38:04 +0200 X-Authenticated: #3483660 X-Provags-ID: V01U2FsdGVkX1+yQqoDC0yylhtq5hthjsYUeHMvkZlAdFNf7gx/9P oFkIVp++1RYAIj Message-ID: <487CF381.3070102@gmx.de> Date: Tue, 15 Jul 2008 20:59:13 +0200 From: Joerg Heinicke User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.15) Gecko/20080621 SeaMonkey/1.1.10 MIME-Version: 1.0 To: users@cocoon.apache.org Subject: Re: Is it possible to restrict file uploads to certain URLs? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.59 X-Virus-Checked: Checked by ClamAV on apache.org On 29.01.2008 01:20, Andy Stevens wrote: > I have a new requirement for one of our sites to allow the users to > upload some files. However, I read in the Cocoon docs/wiki that > switching on the enable-uploads init parameter will make it use the > multipart request factory etc. on all requests it receives. This > seems to me like a lot of unnecessary work (and either disk IO or heap > churn) when only a couple of pipelines will be processing the uploaded > files. If you look at the actual implementation you will see that there isn't a real overhead: CocoonServlet.service(..): if (this.enableUploads) { request = requestFactory.getServletRequest(req); } else { request = req; } That's exactly what you described, as soon as uploads are enabled multipart request factory is used. RequestFactory.getServletRequest(..): String contentType = request.getContentType(); if ((contentType != null) && (contentType.toLowerCase().indexOf("multipart/form-data") > -1)) { // wrap request object in MultipartHttpServletRequest } return request; This means the actual multipart parsing is triggered only by form content type "multipart/form-data" - and that's what you have to set explicitly on the form. So the overhead is only to check for that particular request property. Joerg --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For additional commands, e-mail: users-help@cocoon.apache.org