Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 48225 invoked from network); 29 Dec 2009 04:23:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 29 Dec 2009 04:23:13 -0000 Received: (qmail 32520 invoked by uid 500); 29 Dec 2009 04:23:12 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 32342 invoked by uid 500); 29 Dec 2009 04:23:11 -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 32332 invoked by uid 99); 29 Dec 2009 04:23:11 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Dec 2009 04:23:11 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [67.195.23.152] (HELO n1-vm0.bullet.mail.gq1.yahoo.com) (67.195.23.152) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 29 Dec 2009 04:23:00 +0000 Received: from [67.195.9.81] by n1.bullet.mail.gq1.yahoo.com with NNFMP; 29 Dec 2009 04:22:37 -0000 Received: from [98.137.27.212] by t1.bullet.mail.gq1.yahoo.com with NNFMP; 29 Dec 2009 04:22:37 -0000 Received: from [127.0.0.1] by omp122.mail.gq1.yahoo.com with NNFMP; 29 Dec 2009 04:22:37 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 115232.55481.bm@omp122.mail.gq1.yahoo.com Received: (qmail 33278 invoked by uid 60001); 29 Dec 2009 04:22:37 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1262060556; bh=xTZBK2jwtksK+jYHt4VmiFwvZlPjz/AHSj6c/f3O7G0=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=wAu/rSxBR7Acza1bk1kU5zLrr8zoAX52O3UXOOewKuTMoCcwk7pdz86YuF7N0jL7sRIxNl5rrZK7065sMjkpuf3xrqwuHyD5U8Z+fxK+GRB/DjWKIwmr4gA2N6HQ9z++YfLm3MPnSvBtfOqoosWLaqk4yOE/lYn4RzTNxdJ27Ls= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=IpUPaKmg4zNtzF3EuW/AlhgDVMjcF0YJvbjFoQZ778I4Bv5cPD0CnPD0PLdCgJQnq1YRZn8wOcsiLz3X48yOQalQaCIxkH0BGK15b0PPJyI6y/dTB53mpcb20xnM/LNZtL/z6GH+BN4iK17HQ9PQ7k9spip5tv0kaf7yodTYrKU=; Message-ID: <981483.32675.qm@web113810.mail.gq1.yahoo.com> X-YMail-OSG: z2U2UyUVM1lQc9JADnDhXylgeRGhBpAoxDwaLzROd0l95m8XGEmR2MZpH_0lEpEwEhI_1HmaYWOrQDeLdp4YNEJyKe.WWiy07WbFE4Vvqq8fjsddlJRKV.TGe15tDWRedrLGP80DWvYl1EnvUhd.R0H0q8MvD_K8GnivYn2EkKge2Tel9pY1D.TpYKqPCnsxt9C5ej1v3Opqt1rFFNpdHdbAUd0oneHtfkjxjX425bvYcBudxeZlasELyrHYPwxig8zfZnRDVGawUv.F_Bx4RvSG7vrj5Vno0DBUnQJ6nCb8s1xIW7_L85hVg1SZxQrD2g7DoLBhenXu1Rsvw19qmAjDQu4me_8kTXrg Received: from [93.167.175.94] by web113810.mail.gq1.yahoo.com via HTTP; Mon, 28 Dec 2009 20:22:36 PST X-Mailer: YahooMailRC/240.3 YahooMailWebService/0.8.100.260964 References: <957193.85287.qm@web113815.mail.gq1.yahoo.com> <16d6c6200912281510k53779043v96485cb4d79a9524@mail.gmail.com> Date: Mon, 28 Dec 2009 20:22:36 -0800 (PST) From: Martin Subject: Re: problems using progresslistener with servletfileupload To: Commons Users List In-Reply-To: <16d6c6200912281510k53779043v96485cb4d79a9524@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-4675609-1262060556=:32675" X-Virus-Checked: Checked by ClamAV on apache.org --0-4675609-1262060556=:32675 Content-Type: text/plain; charset=us-ascii Hello Martin, Thanks for your prompt reply! What you are saying certainly explains the problem I am having in that my expectations were incorrect. I must admit though that I am very surprised by this behavior. Even after rereading the documentation I am still left with the impression that progresslistener is intended to give feedback as the file is being uploaded but this is not explicitly stated anywhere. Now I am wondering why even have a progresslistener? Is this feature useful for anything besides indicating how much of a file has been processed right at the very end which doesn't seem that useful to me? Thanks again for your help! Regards, Martin ________________________________ From: Martin Cooper To: Commons Users List Sent: Tue, December 29, 2009 12:10:03 AM Subject: Re: problems using progresslistener with servletfileupload This is why earlier versions of Commons FileUpload didn't have a progress API - it's not possible to make it work as people expect. For the servlet containers I'm familiar with, the container receives the request and stores it in its entirety prior to invoking any servlets or filters or whatever. That means that the actual upload of the data from the browser to the server has already happened before Commons FileUpload has any chance to even see the request, let alone initialise a progress mechanism. So the progress mechanism is tracking the progress of processing the upload once it's already on the server, not the progress of the upload itself. I believe the only way you're going to be able to track the process of the upload itself is to find a container-specific API that lets you see the request as it comes in. I don't know that any of them actually have such a thing, though, so you may be out of luck. (I do seem to recall that Resin has multipart requests somewhat more baked in, so it may have something in place, but it's been a long time since I've looked at it.) -- Martin Cooper On Mon, Dec 28, 2009 at 2:40 PM, Martin wrote: > Hello, > > I am having a very frustrating problem with servletfileupload and progresslistener. I am using commons-fileupload-1.2.1.jar and commons-io-1.4.jar. I would very much like to implement a file upload feature which gives some feedback to the user about the progress so they don't become impatient and give up. To do this I have attached a progresslistener to a servletfileupload as described here: > > http://commons.apache.org/fileupload/using.html > > But I am having a very hard time getting this to work right. After much debugging I have managed to figure out that every single call to update in the progresslistener interface takes place during the call to upload.parseRequest(request) which typically only takes a few milliseconds right at the very end. Currently I am uploading images which take about 5-10 seconds to upload and during most of the upload the progress is undefined and then right at the end it jumps to 100% which is consistent with my debugging. So my question is what am I doing wrong? How do I get the update function in the progresslistener interface to be called periodically while the file is being uploaded instead of only at the very end when it is being processed? > > Thanks for any help! > > Regards, > Martin > > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org --0-4675609-1262060556=:32675--