SitePoint Sponsor

User Tag List

Results 1 to 16 of 16

Thread: Progress bar

  1. #1
    SitePoint Evangelist achintya's Avatar
    Join Date
    Apr 2005
    Location
    Chandannagar(India)
    Posts
    459
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Progress bar

    Hi,
    I want a progress bar with server side checking of file size,% uploaded,time remaining etc. I have googled,but not yet found suitable. Can someone help me?

  2. #2
    SitePoint Addict Jack Matier's Avatar
    Join Date
    Feb 2005
    Posts
    292
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, let me see.. when you initially upload a file with php it sends it to a temp directory... If you get that files name on your server in a popup window you might be able to do a refresh to check the file upload state.

    I should really try this. It would be interesting. I'll come again and contribute back if I get something working (this wouldn't be for another week though).

  3. #3
    SitePoint Addict psyon's Avatar
    Join Date
    May 2004
    Location
    Cedar Rapids
    Posts
    295
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    http://www.google.com/search?hl=en&l...ss&btnG=Search

    As far as I know, they all require you patch PHP though.

  4. #4
    SitePoint Evangelist achintya's Avatar
    Join Date
    Apr 2005
    Location
    Chandannagar(India)
    Posts
    459
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Is anyone know what is php patch and how to use it in my site?

  5. #5
    SitePoint Addict Quaint's Avatar
    Join Date
    May 2004
    Location
    Netherlands
    Posts
    219
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It means you have to modify your SERVER (recompile PHP for Linux, add DLLs in windows AND edit config files). Unless your own your own server, this is probably not going to happen (as your host probably won't do this for you, check it with him/her though!).

    Also note that PHP is pretty static, meaning you'll need a page refresh to modify anything visually.. Perhaps Java is more suitable for your needs?!

    (also perhaps reconsider if you really need the progress bar?)

    Quaint Tech
    - Blog on web development and web technology.

  6. #6
    SitePoint Wizard Nikolas's Avatar
    Join Date
    Feb 2005
    Location
    Greece
    Posts
    1,221
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It would propably much easier to do this with javascript, but don't ask me how, I don't know much about this language.

  7. #7
    SitePoint Addict Quaint's Avatar
    Join Date
    May 2004
    Location
    Netherlands
    Posts
    219
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No, I'm sorry, but frankly it's impossible with Javascript.. (you can't upload using Javascript, it's client-side only). A Java applet would be most convenient.. JSP is possibility.. Perhaps Ajax? (Javascript / Server side link), but that's a bit farfetched..

    The point is, a genuine progress bar will look at the percentage of file it has received.. This information (percentage) is constantly displayed graphically (progress bar..)..

    What you could do using PHP:
    0% -> start
    33% -> upload done
    66% -> File moved
    100% -> done..

    But that is really just ********....

    Quaint Tech
    - Blog on web development and web technology.

  8. #8
    SitePoint Wizard Nikolas's Avatar
    Join Date
    Feb 2005
    Location
    Greece
    Posts
    1,221
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think you can have a progress bar with JS for the loading of a page.

    This should work with file uploads too.

  9. #9
    SitePoint Addict Jack Matier's Avatar
    Join Date
    Feb 2005
    Posts
    292
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, can JS check the size of a file before the upload? (I don't think it can). Considering there is no place to actually check the end filesize before the full upload this would be impossible without changing the server settings and recompiling php.

    I suppose the best thing to do would be to use an image saying that your file is uploading and to please be patient. It would be nice to have a smooth upload bar but I just don't think that's going to happen.

  10. #10
    SitePoint Addict kirikintha's Avatar
    Join Date
    Nov 2004
    Location
    Boulder, CO
    Posts
    290
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What you ned is a flash loader that displays the bitsize, bite loaded, remaining etc, then you have dynamic actionscript that animates accordingly - the only way I know to get it to work outside of some seriously convoluted php programming that never shows the correct size or upload time....

    Or, you just fool people with a fake upload, no progress bar, just a transition until tha page refreshes.

    Most other solutions are useless as they capture incorrect data.
    myspace.com/tarsus
    Technical Coordinator
    BCMT
    "Not impossible, just hard to do!"

  11. #11
    SitePoint Wizard Young Twig's Avatar
    Join Date
    Dec 2003
    Location
    Albany, New York
    Posts
    1,355
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  12. #12
    SitePoint Addict Jack Matier's Avatar
    Join Date
    Feb 2005
    Posts
    292
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Bloody Awesome!

  13. #13
    SitePoint Addict Quaint's Avatar
    Join Date
    May 2004
    Location
    Netherlands
    Posts
    219
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Lol, Ajax turns out to have been a good guess! Looks good!

    Quaint Tech
    - Blog on web development and web technology.

  14. #14
    SitePoint Addict kirikintha's Avatar
    Join Date
    Nov 2004
    Location
    Boulder, CO
    Posts
    290
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    awesome1 never knew - now I have something new to play with!
    myspace.com/tarsus
    Technical Coordinator
    BCMT
    "Not impossible, just hard to do!"

  15. #15
    SitePoint Addict
    Join Date
    Oct 2004
    Location
    USA, Saratoga Springs, NY
    Posts
    296
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here is another solution that's been time tested:
    http://www.raditha.com/php/progress.php
    They say, "Practice makes perfect," yet they also say, "Nobody's perfect". I don't get it.

  16. #16
    Sean N Pixel Inception's Avatar
    Join Date
    Feb 2006
    Location
    Atlanta, GA
    Posts
    280
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by kirikintha
    awesome1 never knew - now I have something new to play with!
    Ajax can do amazing things
    Sean @ Pixel Inception, Inc. www.pixelinception.net
    Web Design & Web Development


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •