473,790 Members | 2,951 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2043
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*******@YaNo peSpamhoo.com> wrote in message
news:uk******** ******@TK2MSFTN GP11.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******** ******@TK2MSFTN GP11.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*******@YaNo peSpamhoo.com> wrote in message
news:uk******** ******@TK2MSFTN GP11.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******** ******@TK2MSFTN GP11.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*******@YaNo peSpamhoo.com> wrote in message
news:uk******** ******@TK2MSFTN GP11.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
2684
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" listing in my address book and (optionally) their name listed on my "news" page of my birtle.com website (listed as "Jane Smith is a Programming GOD") for at least a month. Why not take a moment to read more and possibly boost your ego to all time...
3
1143
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!
1
1257
by: Garett | last post by:
I am creating a document manager of sorts in ASP.net and it would be really nice to have some sort of file upload progress bar for larger files. Companies such as www.websupergoo.com and www.softartisans.com have created file upload tools that show the progress however I'd like to make something myself. Unfortunately, I'm having a bit of trouble figuring out how to get the *** final file size *** before the file is actually...
1
2220
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 it possible to implement it using some other control, for example a floating window? A link to example would also be useful. Thanks, Marko Vuksanovic.
6
10104
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 it possible to implement it using some other control, for example a floating window?
1
2141
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 might be wrong? FileUpload2.aspx <%@ Page Language="C#" AutoEventWireup="true" CodeFile="FileUpload2.aspx.cs" Inherits="FileUpload2" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
2
3707
by: Adam R | last post by:
Looking for an upload progress meter which can works with 'non-patched' PHP4. -- -------------------------------------- Adam Raszkiewicz Brothers-in-arts.com --------------------------------------
0
1409
by: tower.grv | last post by:
Hello. I have created file upload progress bar. It coded with php and AJAX. The problem is it works on some servers but doesn't work on another. Maybe it depends from php or apache version. But maybe from configuration of php or apache. I will describe how it works. When you selects file on the form and click upload, uploading starts
1
1266
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 cancelled,using raiseEvent method. I am sending my code whatever I tried- (When I run the code file uploaded successfully,but I can not see the progess,how much bytes are uploaded) Public Enum TransferProcesses TransferProcess_Upload = 0 End Enum ...
0
10201
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10147
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9987
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7531
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5424
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5552
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4100
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3709
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2910
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.