473,385 Members | 1,757 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,385 software developers and data experts.

Show Upload Progress

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!
Nov 18 '05 #1
3 1129
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" <Je*******@YaNopeSpamhoo.com> wrote in message
news:uk**************@TK2MSFTNGP11.phx.gbl...
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!

Nov 18 '05 #2
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:u8**************@TK2MSFTNGP11.phx.gbl...
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" <Je*******@YaNopeSpamhoo.com> wrote in message
news:uk**************@TK2MSFTNGP11.phx.gbl...
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!


Nov 18 '05 #3
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:u8**************@TK2MSFTNGP11.phx.gbl...
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" <Je*******@YaNopeSpamhoo.com> wrote in message
news:uk**************@TK2MSFTNGP11.phx.gbl...
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!


Nov 18 '05 #4

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

Similar topics

3
by: Brian Birtle | last post by:
**** A CHALLENGE TO THE GURUS - refute the statement "It's impossible to build a file upload progress meter using ASP.NET" **** First person to prove me wrong gets "All Time .NET Programming GOD"...
3
by: Jeff S | last post by:
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!
4
by: Pavils Jurjans | last post by:
Hello, I have the following setup: The page that contains the form with file upolad HTML control resides on another server that doesn't have ASP.NET available. It may well be just static...
1
by: Marko Vuksanovic | last post by:
I am trying to implement a file upload progress indicator (doesn't have to be a progress bar) using atlas... I do realize that the indicator cannot be implemented using Update panel control, but is...
6
by: Marko Vuksanovic | last post by:
I am trying to implement a file upload progress indicator (doesn't have to be a progress bar) using atlas... I do realize that the indicator cannot be implemented using Update panel control, but is...
1
by: Marko Vuksanovic | last post by:
I used the following code for implementing a file upload progress indicator, using UpdateProgress Panel, though I have a problem that FileUpload.Has File always returns false. Any suggestions what...
3
by: markus.rietzler | last post by:
i want to do (multiple) file upload(s) and display a progress bar. with firefox and safari it is no problem at all. only IE makes some problems. my script is based on ajax-uploader, which can be...
3
by: shapper | last post by:
Hello, I need to upload a file. Can I only do this with the File Upload control? I also need the following: - Send upload info, upload percentage, continuously to a JavaScript function so...
1
by: Swan | last post by:
Can anyone plz tell me,I have OCX created Http upload control.In that I am sending chunk wise data.Everything is working fine.My question is-how can I show Upload progress or Uploading...
6
by: neovantage | last post by:
Hey all, i have installed Uber uploader on my server. and it is working perfectly. It shows progress bar after submitting form. I want that when i upload an image or a file it shows the progress in...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.