Reply to Re: UPLOAD with progess bar

Re: UPLOAD with progess bar new!
by kren, 17 years, 3 months ago
OK,
this is UploadHandler.php ......
include('class.upload.php');
$id  = $_GET['sessionId'];
$id = trim($id);

session_name($id);
session_start();
$inputName = $_GET['userfile'];
$tempLoc   = $_FILES[$inputName]['tmp_name'];
echo $_FILES[$inputName]['error'];

$handle = new upload($_FILES[$inputName]);
if ($handle->uploaded) {
  /*********Optional for image manipulation*********
  $handle->file_new_name_body   = 'image_resized';
  $handle->image_resize         = true;
  $handle->image_x              = 100;
  $handle->image_ratio_y        = true;
  */
  $handle->process('../../uploadDir');
  if ($handle->processed) {
    $_SESSION['value'] = -1;
    /****** for debugger `class.upload.php` uncomment this line *******/
    //$_SESSION['error'] = $handle->log;
    $handle->clean();
  } else {
    echo 'error : ' . $handle->error;
  }
}


then for debugging .... correct file: GetInfoHandler.php
$id = $_POST['sessionId'];
$id = trim($id);
session_name($id);
session_start();
echo $_SESSION['value'];
/****** for debbuger `class.upload.php` uncomment this line *******/
//echo $_SESSION['error'];
if($_SESSION['value']==-1) {
    session_destroy();
}

..and at last for output debugger find this line in file dhtmlXVault.js:
tblContent.rows[1].cells[0].innerHTML += "Done";

and add these lines bellow:
/****** for debugger `class.upload.php` uncomment this two lines *******/
//result = xmlHttp.responseText;                            
//tblContent.rows[1].cells[0].innerHTML += result;

enjoy! :)Reply

Your reply

Name *
Email 
Title *
Text *
CAPTCHA image
Enter the code displayed on the image:
Click on the image to generate another one if it is hard to read it. The case is important