Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / August 2007

Tip: Looking for answers? Try searching our database.

Progress bar

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Paulo - 29 Aug 2007 19:32 GMT
Hi, while the user is uploading a file, is possible to show a progress bar?
Using VS 2005 Asp.net 2.0 C#

Thanks!
Mike - 30 Aug 2007 12:27 GMT
It is but why? The file upload takes like a second, so your progress bar
will never been seen.
Now if you were uploading the file and processing it all at the same time,
then maybe the progress bar can be seen, but just for an upload, makes no
sense due to the time it takes for it to upload.

> Hi, while the user is uploading a file, is possible to show a progress
> bar? Using VS 2005 Asp.net 2.0 C#
>
> Thanks!
Steve - 30 Aug 2007 13:40 GMT
The server doesn't know what size the file is until it's done uploading,
 so I think your best option is to either use an animated gif to show
"something" while the upload is going on, or use AJAX. The postback
itself will contain the file, so you'll need to use client-side code to
do the displaying.

Steve C.
MCSD,MCAD,MCSE,MCP+I,CNE,CNA,CCNA

> Hi, while the user is uploading a file, is possible to show a progress bar?
> Using VS 2005 Asp.net 2.0 C#
>
> Thanks!
Mike - 30 Aug 2007 14:04 GMT
true, but regardless of what is used, the upload takes a second or so, so it
may never even be seen by the user.
I have an upload page and I tried adding one to it, but due to the time it
actually took to upload the file the user never saw the progress/animation
on the screen.

> The server doesn't know what size the file is until it's done uploading,
> so I think your best option is to either use an animated gif to show
[quoted text clipped - 9 lines]
>>
>> Thanks!
Steve - 30 Aug 2007 14:23 GMT
The OP didn't say anything about how large the file is. It could be a
10MB file, which would take longer than a second or two?

Steve C.
MCSD,MCAD,MCSE,MCP+I,CNE,CNA,CCNA

> true, but regardless of what is used, the upload takes a second or so, so it
> may never even be seen by the user.
[quoted text clipped - 15 lines]
>>>
>>> Thanks!
Paulo - 30 Aug 2007 14:36 GMT
The file size may vary, example if the size is 10MB @ 10/KBs will take ~
5mins... I dont know the user bandwidth... so I would like to show to him
some progress..

Thanks!

> The OP didn't say anything about how large the file is. It could be a 10MB
> file, which would take longer than a second or two?
[quoted text clipped - 21 lines]
>>>>
>>>> Thanks!
Mike - 30 Aug 2007 14:49 GMT
then yeah you can use an atlas window to show the progress, etc.

> The file size may vary, example if the size is 10MB @ 10/KBs will take ~
> 5mins... I dont know the user bandwidth... so I would like to show to him
[quoted text clipped - 27 lines]
>>>>>
>>>>> Thanks!
Juan T. Llibre - 30 Aug 2007 15:17 GMT
re:
!> The server doesn't know what size the file is until it's done uploading

Indeed.

re:
!>  so I think your best option is to either use an animated gif to show
!> "something" while the upload is going on, or use AJAX.

Another option would be to use an animated GIF to keep the user
entertained while the upload finishes and create a FileSystemWatcher
object to redirect the user to "uploadFinished.aspx" when the file has finished uploading.

To do that, you'll have to import the FileSystemWatcher namespace :

System.IO.FileSystemWatcher

Something like this ?

public void CreateWatcher()
{
//Create a new FileSystemWatcher
FileSystemWatcher watcher = newFileSystemWatcher();

//Set the filter to only catch ZIP files.
watcher.Filter = "*.zip";

// Perhaps a variable could be created to hold the exact name
// of the file in the filter, obtained from the File.Upload textbox.

//Subscribe to the Created event.
watcher.Created += new FileSystemEventHandler(watcher_FileCreated);

//Set the monitored path to your upload directory
watcher.Path = @"C:\Temp\";

//Enable the FileSystemWatcher events.
watcher.EnableRaisingEvents = true;
}

void watcher_FileCreated(object sender, FileSystemEventArgs e)
{
//When the .zip file has been created in C:\Temp\ ...
Response.Redirect("~/uploadFinished.aspx", false);
return;
}

I haven't done this...but it seems quite possible.
If you try it, please let us know if it worked.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
> The server doesn't know what size the file is until it's done uploading, so I think your best option is to either use
> an animated gif to show "something" while the upload is going on, or use AJAX. The postback itself will contain the
[quoted text clipped - 6 lines]
>>
>> Thanks!
dean@brettle.com - 30 Aug 2007 23:31 GMT
> Hi, while the user is uploading a file, is possible to show aprogressbar?
> Using VS 2005Asp.net2.0 C#

Yes.  There are several file upload progress bar components available,
including my open-source NeatUpload component:

http://www.brettle.com/neatupload

--Dean

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.