Using jquery uploadprogress: http://t.wits.sg/2008/06/25/howto-php-and-jquery-upload-progress-bar/

I have pecl uploadprogress installed on the server currently Im just really not sure how this works.

Where I am having trouble is in the uploadprogress.php basically this is the part where it returns

if(@$_GET['id']){
  echo json_encode(uploadprogress_get_info($_REQUEST['id']));
  exit();
}

from what I see in the example.

Basically I am not really sure where to add my code to do all the dirty work, do i put it within that statement? When I do it does not really do anything. Has anyone had any experience with this extension/plugin?

It seems that i do have it working if i just have it like that. But when i try to add my code does not work.
Thanks.

    You'd need to either add it before "echo json_decode" and/or modify the way it does the output or in the uploadprogress_get_info function.

    i.e.

    if(@$_GET['id']){
      // do stuff
      $mystuff = 'Hello World!';
      $progress = uploadprogress_get_info($_REQUEST['id']);
      echo json_encode(array($mystuff, $progress));
      exit();
    } 

      Hey thanks for the response! Actually I found how it works.

      Quick example:

      uploadform.php // has my html form & js stuff

      uploadscript.php // has what I want to do DB/UPLOAD

      uploadprogress.php // deals with the echo json_encode(uploadprogress_get_info());


      in uploadform i have

      <form action="uploadscript.php" onsubmit="doUpload()" ></form>

      So its all working I see the progress bar move. The problem is part of my script never finishes. Once it hits move_uploaded_file(file,path); it dies from here and it also never moves the file. Anything below that also never happens.
      Anyone have any idea why? Thank you!

        Do you have error reporting turned on? See [man]error_reporting[/man]

          Write a Reply...