Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Show Upload Progress

Reply
Thread Tools

Show Upload Progress

 
 
Jeff S
Guest
Posts: n/a
 
      04-05-2004
I'm enabling users to upload files to the server. I'd like to show them some
indication of percent complete. How can this be done?

Thanks!


 
Reply With Quote
 
 
 
 
Alvin Bruney [MVP]
Guest
Posts: n/a
 
      04-06-2004
One solution is to use a timer. Set a flag to show that the load has
started. Everytime the timer event fires examine the flag. As long as the
flag is set, display your message. When it's done, change the flag and stop
the timer.

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/27cok
"Jeff S" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I'm enabling users to upload files to the server. I'd like to show them

some
> indication of percent complete. How can this be done?
>
> Thanks!
>
>



 
Reply With Quote
 
 
 
 
Joe Fallon
Guest
Posts: n/a
 
      04-06-2004
This approach works to keep the user occupied while the file is uploaded.
But it does not show true progress as a percentage of the task completed.

ASP.Net blocks you from getting any data once the upload begins.
So you have to write code to intercept the request and handle it yourself.

In fact, to get a true percentage is extremely difficult. I read a thread on
the topic that lasted almost 2 years. Some guys posted 90% of the code
required to do it and then hired themselves out to 3rd party companies and
built it for them. To my knowledge there is no free public domain code for
how to do this.
--
Joe Fallon




"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
news:(E-Mail Removed)...
> One solution is to use a timer. Set a flag to show that the load has
> started. Everytime the timer event fires examine the flag. As long as the
> flag is set, display your message. When it's done, change the flag and

stop
> the timer.
>
> --
> Regards,
> Alvin Bruney [ASP.NET MVP]
> Got tidbits? Get it here...
> http://tinyurl.com/27cok
> "Jeff S" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > I'm enabling users to upload files to the server. I'd like to show them

> some
> > indication of percent complete. How can this be done?
> >
> > Thanks!
> >
> >

>
>



 
Reply With Quote
 
Jeff S
Guest
Posts: n/a
 
      04-06-2004
Sounds like this will do for my situation. I understand it's not a true
measure of progress, but in my situation I'm most interested in letting the
user know that the upload is not hung and to please continue waiting. I'd
hate for them to restart their session or repeatedly click the "upload now"
button.

I'm using the HtmlInputFile control, and I'm a bit sketchy on *how* it works
(although I do have it all working). I suppose it works with the browser to
enable navigation of the client machine to find the file to be uploaded, but
beyond that I'm not sure what happens in order to copy the file from the
client to the server. I have a separate button that initiates a postback:
does the uploaded file come in as part of the POST (postback) data? If not,
how doess it come in? Where and when would I initiate the timer? and where
would I set the flag? I could figure it all out except that I'm just not
clear on when/where in the code I'd get a chance to start the timer and set
the flag prior to the upload actually beginning.

Thanks.



"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
news:(E-Mail Removed)...
> One solution is to use a timer. Set a flag to show that the load has
> started. Everytime the timer event fires examine the flag. As long as the
> flag is set, display your message. When it's done, change the flag and

stop
> the timer.
>
> --
> Regards,
> Alvin Bruney [ASP.NET MVP]
> Got tidbits? Get it here...
> http://tinyurl.com/27cok
> "Jeff S" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > I'm enabling users to upload files to the server. I'd like to show them

> some
> > indication of percent complete. How can this be done?
> >
> > Thanks!
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Progress bar to show the progress of a task Charlie Zhang Java 3 08-16-2004 05:53 PM
How to detect sizeof upload in order to show status of browser file upload? Heather Fraser Java 0 07-05-2004 12:35 AM
Upload Progress in ASP.NET Garett ASP .Net 1 05-01-2004 12:27 AM
File Upload Progress Kenneth Keeley ASP .Net 2 10-21-2003 10:46 PM
*Impossible* to build an upload progress meter using ASP.NET. Can you prove me wrong? Brian Birtle ASP .Net 3 10-16-2003 03:53 PM



Advertisments