You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ole Ersoy <ol...@gmail.com> on 2011/09/04 04:09:51 UTC

[Servlet 3.0] Monitoring File Upload Progress

Hi,

Anyone know whether it's possible to monitor progress of a file upload?

TIA,
- Ole

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: [Servlet 3.0] Monitoring File Upload Progress

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ole,

On 9/6/2011 11:03 AM, Ole Ersoy wrote:
> Described in this article: 
> http://www.ibm.com/developerworks/web/library/wa-aj-dwr/?ca=dgr-lnxw06AjaxDWR
>
>  I could just go back to commons file upload, but thought I'd look
> around to see if anything something similar could be done with
> servlet 3.0.

The servlet API does not have any such provisions: your code executes
after the file upload has completed.

If you want to interact with the stream, you'll have to either handle
the stream yourself or use a library (like commons-fileupload) that
lets you watch the stream.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk5mbkMACgkQ9CaO5/Lv0PC/JQCfRV9lZuCJ+Zvc5IL7ooctJYVh
TcEAnjkOqfAOgJPzhaXUfh2FOWlT/gZD
=MXx4
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: [Servlet 3.0] Monitoring File Upload Progress

Posted by Ole Ersoy <ol...@gmail.com>.
Hi Andre,

I'm looking for something like this:

pfu.setProgressListener(new FileUploadProgressListener());

Described in this article:
http://www.ibm.com/developerworks/web/library/wa-aj-dwr/?ca=dgr-lnxw06AjaxDWR

I could just go back to commons file upload, but thought I'd look around to see if anything something similar could be done with servlet 3.0.

Thanks,
- Ole


On 09/05/2011 03:12 PM, André Warnier wrote:
> Ole Ersoy wrote:
>> Hi,
>>
>> Anyone know whether it's possible to monitor progress of a file upload?
>
> What do you mean by "monitoring" ?
>
> Is it a question of providing the user with some feedback, like a
> progress bar ?
>
> If so, then one of the easier ways would be to write your own java
> applet, downloaded and run by the browser in your upload form, to do the
> upload and display some progress bar to the user.
> You may want to search for something already available to do it though,
> because writing it from scratch is not really trivial.
> Personally, I would only do that if it was /really/ worth the effort.
> Like if many users get impatient and break off the upload before it
> finishes. Or of course if the marketing guys insist on it, for the look.
> But then tell them the cost.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: [Servlet 3.0] Monitoring File Upload Progress

Posted by André Warnier <aw...@ice-sa.com>.
Ole Ersoy wrote:
> Hi,
> 
> Anyone know whether it's possible to monitor progress of a file upload?

What do you mean by "monitoring" ?

Is it a question of providing the user with some feedback, like a progress bar ?

If so, then one of the easier ways would be to write your own java applet, downloaded and 
run by the browser in your upload form, to do the upload and display some progress bar to 
the user.
You may want to search for something already available to do it though, because writing it 
from scratch is not really trivial.
Personally, I would only do that if it was /really/ worth the effort. Like if many users 
get impatient and break off the upload before it finishes.  Or of course if the marketing 
guys insist on it, for the look.  But then tell them the cost.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org