Progress bar web form file.add BEGINNER

Discussion in 'ASP .Net Web Controls' started by cindy, May 24, 2006.

  1. cindy

    cindy Guest

    I cannot see how to use progressbar when I programmatically add file to
    Windows SharePoint Services document library
    Code that adds file

    SPWeb site;
    FileInfo TheFile = new FileInfo(StrFullFileName);
    FileStream fStream = File.OpenRead(StrFullFileName);
    byte[] contents = new byte[fStream.Length];
    fStream.Read(contents, 0, (int)fStream.Length);
    fStream.Close();
    finalurl = desturl + StrFileName;
    site = new SPSite(finalurl).OpenWeb();
    SPFile myfile = site.Files.Add(finalurl,contents);

    the file is large and i want progress bar for user to see how much progress
    to end. Is there a progressbar web control? How do I tell control to start
    and end with site.Files.Add(finalurl,contents) progress? The reason I am
    doing this is I can't figure out how to prevent any user interactions with
    the form until the file uploads (like close it) so I at least want to show
    progress of adding file. Then form closes after file add is done.
    --
    cindy
     
    cindy, May 24, 2006
    #1
    1. Advertising

  2. That's a pretty common question, a very easy task for a Windows Form apps,
    but very worky for a web apps -- the easiest solution is to display an
    animated gif (or some other animation) to let them know it is thinking, when
    done make the gif not visible -- that way you only render the page twice
    (once for starting and once for stopping).

    There are other methods but they require a lot more work. What you need is
    client side rendering with server side updates -- good luck.



    "cindy" <> wrote in message
    news:...
    >I cannot see how to use progressbar when I programmatically add file to
    > Windows SharePoint Services document library
    > Code that adds file
    >
    > SPWeb site;
    > FileInfo TheFile = new FileInfo(StrFullFileName);
    > FileStream fStream = File.OpenRead(StrFullFileName);
    > byte[] contents = new byte[fStream.Length];
    > fStream.Read(contents, 0, (int)fStream.Length);
    > fStream.Close();
    > finalurl = desturl + StrFileName;
    > site = new SPSite(finalurl).OpenWeb();
    > SPFile myfile = site.Files.Add(finalurl,contents);
    >
    > the file is large and i want progress bar for user to see how much
    > progress
    > to end. Is there a progressbar web control? How do I tell control to
    > start
    > and end with site.Files.Add(finalurl,contents) progress? The reason I am
    > doing this is I can't figure out how to prevent any user interactions with
    > the form until the file uploads (like close it) so I at least want to show
    > progress of adding file. Then form closes after file add is done.
    > --
    > cindy
     
    Rob R. Ainscough, May 24, 2006
    #2
    1. Advertising

  3. Hi cindy,

    Thank you for post!

    Besides Rob's suggestion, you can take a look at following article:

    #Build a Dynamic Progress Page for ASP.NET Pages
    http://www.eggheadcafe.com/articles/20050108.asp


    Regards,
    Walter Wang
    Microsoft Online Community Support

    ==================================================
    When responding to posts, please "Reply to Group" via your newsreader so
    that others may learn and benefit from your issue.
    ==================================================

    This posting is provided "AS IS" with no warranties, and confers no rights.
     
    Walter Wang [MSFT], May 24, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ivan Demkovitch

    Re: Web Form Progress Bar

    Ivan Demkovitch, Aug 13, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    1,198
    Alan Z. Scharf
    Aug 19, 2003
  2. Steve C. Orr, MCSD

    Re: Web Form Progress Bar

    Steve C. Orr, MCSD, Aug 13, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    434
    Steve C. Orr, MCSD
    Aug 13, 2003
  3. aj

    Web Form Progress Bar

    aj, Aug 13, 2003, in forum: ASP .Net
    Replies:
    4
    Views:
    4,253
    Alan Z. Scharf
    Aug 19, 2003
  4. Charlie Zhang
    Replies:
    3
    Views:
    1,334
    Paul Lutus
    Aug 16, 2004
  5. Rob

    progress bar or guage bar

    Rob, Jul 11, 2003, in forum: ASP General
    Replies:
    6
    Views:
    222
    Chris Barber
    Jul 12, 2003
Loading...

Share This Page