To get the upload status during upload process using fileupload control

ajeeshco

Well-known member
Joined
Sep 19, 2006
Messages
257
Location
Cochin, India
Programming Experience
3-5
Hi,
I would like to know whether it is possible to get How many bytes of data is actually uploaded during the upload process using FileUpload control in asp.net 2.0 so that I can show its current status on the webform. Thanks in advance.:)
 
In my IE browser the progress of the fileupload displays by default at the bottom status bar (some progress movement at least :)).

If you still want to do progress you can take the FileUpload.FileContent property which is a Stream and read small parts from it into a buffer that you in turn write to a FileStream, this as you write the total progress into a session specific Application state (session id may be utilized, see here). To read and display this progress value you need another page that postbacks often and get the current value from server. This may either be a Javascript popup window initiated from the upload button onclick or a frame window.
 
Thanks, but what about ajax?

Hi JohnH,
Thanks for the tip:). But one of my colleagues told me that it will be better if I use ajax for the same. I think it will be better if the progress bar be displayed in the same window rather than in a separate pop up window. Can you say which is better?
 
A solution using asynchronous Javascript would run smoother, true, because instead of server postbacks to get the progress information you would use client side Javascript to connect to a written xml file and fetch the information time and again, but this also requires good Javascript programming knowledge. Perhaps the official ATLAS ajax library (currently in RealaseCandidate) has got some useful feature for this?
 
Back
Top