473,320 Members | 1,969 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Progress Bar

Hi and TIA! When uploading files I would like to show a progress indicator
as to what's going on. Currently the user clicks the button, the file gets
uploaded, but there's no visual indication that the upload has even begun.
Any advice or guidance is appreciated. Thanks for your time

--

******************
Reggie
Nov 22 '05 #1
2 1261
MUS
Hi Reggie!

File uploading in itself is an atomic task so there are only 3 types of
events that are possible with such configuration:

1) Upload Start Event
2) Upload Complete Event
3) Upload Interrupted/Aborted Event

NOTE: Its also quite possible that api is configured to raise events
based on its internal state i.e. raise a event where every 10% of the
bytes get uploaded.

What ever the case there be, what you need to do is to register event
handlers for the events and then in the event handlers perform action
(as mentioned below);

private void RegisterFileUploadEvents()
{
// Register File Upload Event
FileUploadLibrary.UploadStarted +=
new EventHandler(fileupload_started);
// Register File Complete Event
FileUploadLibrary.UploadComplete +=
new EventHandler(fileupload_complete);
// Register Abort Event
FileUploadLibrary.UploadAborted +=
new EventHandler(fileupload_interrupted);
}

private void fileupload_started(object sender, EventArgs e)
{
this.StepProgressBar();
this.MaterializeToStatusBar("File upload has started");
}

private void fileupload_complete(object sender, EventArgs e)
{
this.StepProgressBar();
this.MaterializeToStatusBar("File upload complete");
}

private void fileupload_interrupted(object sender, EventArgs e)
{
this.StepProgressBar();
this.MaterializeToStatusBar("File upload has been interrupted. Please
try again later");
}

and your "StepProgressBar()" and "MaterializeToStatusBar(...)" will go
like this:

private void StepProgressBar()
{
if (this.progressBar1.Value < this.progressBar1.Maximum)
{
this.progressBar1.Value += this.progressBar1.Step;
}
}

Note: You can set the "Maximum/Step" properties from properties window

private void MaterializeToStatusBar(String message)
{
this.lblStatusMessage.Text = message;
this.Refresh();
}

At times, Timer Control is also used to tick the status bar.

I hope this might be of some help.

Let me know in case of any inconsistancy.

Regards,

Moiz Uddin Shaikh
Software Engineer
Kalsoft (Pvt) Ltd

Nov 22 '05 #2
Search for SlickUpload...

An HttpModule that does what you want.

Nov 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: SpamProof | last post by:
I got an animated gif that is a barber pole spinning that I want to use as a progress bar. The problem is that is stops spinning (shows 1 frame) when my browser is processing a submited request...
7
by: Pepi Tonas | last post by:
I have a form that takes some time to load because it has to populate some Data. I was trying to display a form on top of it with an activity bar so that user can see that something's going on. ...
1
by: scorpion53061 | last post by:
this code came from cor and I think Armin authored it. I am trying to download an access database and track its progress. It is reading the size fo the file but I am unsure of how to get the...
8
by: Brian Henry | last post by:
I created a smooth progress bar with this code.. but if you update the values in a row quickly of it and watch it on screen it flickers... how would i change this to reduce the flickering?...
8
by: WhiteWizard | last post by:
I guess it's my turn to ASK a question ;) Briefly my problem: I am developing a Windows app that has several User Controls. On one of these controls, I am copying/processing some rather large...
1
by: daniel_xi | last post by:
Hi all, I am running a VS 2003 .NET project on my client machine (Win 2000 SP4, ..NET framework 1.1), running an ASP.NET application on a remote web server (Win 2000 Server, IIS 6.0, .NET...
15
by: eladla | last post by:
Hi! I am creating a composite control the does some of it`s own data access. I want to display a progress bar between the time the page is loaded and the control place holder is displayed and...
5
by: Aggelos | last post by:
Hello I am doing sevreral scripts like sending a newsletter that might take a while to finish first to prevent the browser from timing out and to keep the user informed of the process progress I...
1
by: Bob | last post by:
Hi, I am having trouble seeing how this bolts together. The UI starts a process which involves a long running database update. All Database activity is handled by a class called DT. DT has a...
0
by: jags_32 | last post by:
Hello We use MFG-PRO as our ERP system which in turn uses Progress databases. In the old version of SQL 2000, using DTS packages, we used to set the code page via command prompts and execute DTS...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.