Return-Path: X-Original-To: apmail-commons-user-archive@www.apache.org Delivered-To: apmail-commons-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 41FC97766 for ; Sun, 18 Sep 2011 12:45:20 +0000 (UTC) Received: (qmail 15573 invoked by uid 500); 18 Sep 2011 12:45:19 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 15460 invoked by uid 500); 18 Sep 2011 12:45:18 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 15449 invoked by uid 99); 18 Sep 2011 12:45:18 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 18 Sep 2011 12:45:18 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of outroalex@gmail.com designates 209.85.161.43 as permitted sender) Received: from [209.85.161.43] (HELO mail-fx0-f43.google.com) (209.85.161.43) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 18 Sep 2011 12:45:10 +0000 Received: by fxh19 with SMTP id 19so3965074fxh.30 for ; Sun, 18 Sep 2011 05:44:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=+sq3jmI1s2RvQ/CXDO5YM31Sp/TEaiYfajOUqzxuBf8=; b=xzp/c/jW25ZiCwTnsftwep8UIjn7VmkW9B9rDi4QsMQT5yLZPCT1W9wBJdP7c7djoz InYlj2lipWlc1q8SH1aD1z2qlHbS9m+tNXFDJdrEgu2qFw4rqymYsRfVw7U6YWkSQpWL J1A7Xk6yS22k/a8OAc5Sg+oZSYCU1iF9CZFi0= Received: by 10.223.26.135 with SMTP id e7mr3124270fac.106.1316349890669; Sun, 18 Sep 2011 05:44:50 -0700 (PDT) MIME-Version: 1.0 Received: by 10.152.3.168 with HTTP; Sun, 18 Sep 2011 05:42:04 -0700 (PDT) In-Reply-To: References: From: Alex Date: Sun, 18 Sep 2011 09:42:04 -0300 Message-ID: Subject: Re: [fileupload] ServletFileUpload.setSizeMax only considered once request is complete To: user@commons.apache.org Content-Type: multipart/alternative; boundary=00151747b4aaa22bf104ad369703 X-Virus-Checked: Checked by ClamAV on apache.org --00151747b4aaa22bf104ad369703 Content-Type: text/plain; charset=ISO-8859-1 Hello, When I do this: FileItemFactory factory = new DiskFileItemFactory(); > ServletFileUpload upload = new ServletFileUpload(factory); > upload.setSizeMax(100 * 1024 * 1024); // 100 MB FileUpload will accept the entire request before finally throwing the exception if the sum of the sizes of all files exceeds the set limit. Is there any way for it to preemptively stop the request? Thanks - Alexandre --00151747b4aaa22bf104ad369703--