Better progressbar?
-
Hi In my application I allow for users to upload documents to a server via a web service. I recently created a progress form to show the progress of the documents being uploaded by incrementing a progressbar and updating some labels. However, the progress bar increments are equal to the size of the current document, so it updates in blocks. Is there any way to get the current byte or kilobyte being uploaded and increment the progress bar with that to create a better looking progress bar that continuously updates?
-
Hi In my application I allow for users to upload documents to a server via a web service. I recently created a progress form to show the progress of the documents being uploaded by incrementing a progressbar and updating some labels. However, the progress bar increments are equal to the size of the current document, so it updates in blocks. Is there any way to get the current byte or kilobyte being uploaded and increment the progress bar with that to create a better looking progress bar that continuously updates?
if you upload by sending chunks of data, then yes you could use the exact number of bytes transferred so far. OTOH if your upload is a single action with no progress reporting, then you don't really know; you could still use a timer to have the progress bar advance corresponding to the amount of bytes in that upload, based on an assumed upload rate, which you could derive from the uploads done before, so only the first upload would have a jerky progress, and even that could be remedied by starting with either a historic upload rate, or a reasonable first estimate. So it all depends on how you upload things. Since you asked, I expect you'd be in the latter category. :)
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.