Progress Bar On Image Upload..

Discussion in 'Programming' started by adamjblakey, Mar 27, 2007.

  1. #1
    Hi,

    I am after a progress upload bar using php and java/ajax. I have found quite a few examples but i need it to work on PHP Version 4.3.2 and most of them will not. Also i cannot install a patch to get this to work on the server as i do not have root access.

    Any help would be great.

    Cheers,
    Adam
     
    adamjblakey, Mar 27, 2007 IP
  2. jgoddard

    jgoddard Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You can't use a progress bar when uploading images on the web because once you click the submit button, the page reloads and uploads it at the same time, there's no way to update your page...

    Even using AJAX, the file is only uploaded when the page is POSTed to the server.

    Usually people find an animated GIF of a progress bar and just show that while the page is loading but it doesn't reference the actual speed or progress of the upload.
     
    jgoddard, Mar 27, 2007 IP
  3. commandos

    commandos Notable Member

    Messages:
    3,648
    Likes Received:
    329
    Best Answers:
    0
    Trophy Points:
    280
    #3
    i think it can be done , what about when you upload a file to youtube you can see the actual speed transfer and a progress bar , i'm sure there is a way (not very sure if i even saw this script somewhere ...)
     
    commandos, Mar 27, 2007 IP
  4. TwistMyArm

    TwistMyArm Peon

    Messages:
    931
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Never having uploaded to Youtube, I would guess that it's actually a Flash or Java program that is running in the browser doing the uploading (as opposed to via a normal HTML form).
     
    TwistMyArm, Mar 27, 2007 IP
  5. Robert Plank

    Robert Plank Peon

    Messages:
    55
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Robert Plank, Mar 27, 2007 IP
  6. bibel

    bibel Active Member

    Messages:
    289
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    58
    #6
    Really ?
    how about having a hidden iframe in the page and submitting the form in that iframe.

    There are 3 ways of making an upload progress bar :
    1)php and ajax (requires a patch for php)
    2) perl and ajax (i have tried a few perl scripts, but it didn't work as well as it should)
    3)JAVA applet (the best way, java rulz :) )
     
    bibel, Mar 28, 2007 IP
  7. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    #7
    no patch required : http://pecl.php.net/package/uploadprogress

    I've also had limited success with showing progress using curl callbacks and javascript, however uploading large files causes your html being downloaded to reach MB's in size and browsers start to crash .....
     
    krakjoe, Mar 28, 2007 IP