Overview
Features
Download
Documentation
Community
Add-Ons & Services

Upload progress?

Please post support and help requests here.

Upload progress?

Postby francisr » 30 Apr 2008, 16:51

Hi,

I have a GUI appication that uploads video files. Now I would like my UI to update a progress bar when uploading a file. I wonder if there is a way to get feedback from the Poco code on how much of the file has been uploaded yet (I am using HTTPRequest and HTTPClientSession classes in Poco::Net).

Kind regards,

Francis
francisr
 
Posts: 21
Joined: 09 Dec 2007, 13:19

Re: Upload progress?

Postby guenter » 02 May 2008, 11:49

Since HTTPClientSession uses a stream to upload data, all you have to do is put notifications about progress in between your write operations. A possible way would be to use Task and TaskManager, which provide a simple notification mechanism for task progress. An issue in GUI applications is always getting things such as progress information from background threads to the GUI thread. A pattern that works well is to put all notifications into a NotificationQueue, and then, in the GUI thread's onIdle event/callback/etc., get the notifications from the queue and process them (e.g., update the progress bar). If you use Task and TaskManager, you should be able to register a NotificationQueue with the TaskManager as an observer, so that all notifications coming from tasks end up in the queue.
guenter
 
Posts: 1138
Joined: 11 Jul 2006, 16:27
Location: Austria


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron