file uploads with progress bar

T

Todd Denlinger

Ok,

I know how to upload a file in asp.net using the <input
type="file" runat="server"> control. What I don't know
how to do is monitor the progress of the upload so that I
can show the end-user a progress bar, or something.

Anyone have any ideals or can point me to a sample?

Thanks,
Todd
 
M

Marina

I don't think there is an easy way to do this. There are companies that sell
components with progress bars for uploads.

I believe SoftArtisans is one of them, and there are a few others as well.
visit www.asp.net, and maybe search on google to find them.
 
T

Todd Denlinger

Thanks Marina

You may be right, a progress bar may be fairly complex.
However, it looks like you can open another window using
javascript and
<form id="Upload" method="post" runat="server"
onsubmit="OnUpload()">

then closing the javascript window after the upload by using

<body ms_positioning="FlowLayout" onunload="OnUnload()">

It wouldn't be a progress bar, but you'd have an animated
gif at least.

Regards,
Todd
 
M

MSFT

Hi todd,

I agree with Marina that there may not be an easy way to implement in
ASP.NET. Since the Progress bar locate on client side, it needs to
communicate with server side to determine the progress. However, when you
upload a file, you just send a request to server side and wait for
response. There is no channel for transfering progress information during
upload.

Normally, there are two weak work around for this issue:

1. Embeding some third party ActiveX control in the web page and use it to
upload file. The third party activex control will upload the file with
sockets and display a progress bar.

2. Display a mendacious progress bar like a GIF picture, or a progress bar
like:

For i=1 to 10000

Progressbar.position= Progressbar.position+1
loop

Hope this help,

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
M

Marina

Agreed, you could do that. But I don't think there would be an easy way to
actually judge the progress of the upload - as in, how much of it went up.

But yes, you could put an animated image up until the upload was complete...
 
K

Kenneth Keeley

I have tried this idea and I think it might work. but could you give a more
complete example of the code in both pages. I have been able to open the new
window but how do I close it when the upload is finished. Also what stops
the progress bar from being displayed if the form is invalid.
 
R

Reddy

One more solution which might be helpful is to have a anim gif within a
layer and the form within another layer. Hide the form layer and make the
layer containing anim gif visible when the submit button is clicked. In this
case you don't need to open a pop up window.

Reddy
 
K

Kenneth Keeley

Ok then, How do I do that. I would like to see the code to produce one of
these results.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top