Reply to class instantiating error on live server

class instantiating error on live server new!
by Cyber Pk, 11 years, 4 months ago
hi,

i am using this class to uploaded multiple images, working perfect on local server with php 5.4 but causing trouble on liver testing server. funny thing is when i just put the code in a simple folder it works fine. but when i integrate it in my project it gives error (HTTP Error 500). looks like its breaking on class instantiating(working smoothly on local and also works on live server when put in separate folder ) below is my code, appreciate any help

$files = array();
foreach ($_FILES['item_image'] as $k => $l) {
  foreach ($l as $i => $v) {
    if ( !array_key_exists($i, $files) )
      $files[$i] = array();
    $files[$i][$k] = $v;
	}
}

//print_r($files);  exit();
foreach ( $files as $file ) {
  if(!empty($file['name'])){			
    $largeUpload 		= 'up/large/';
    $thumbUpload 		= 'up/thumbs/';			
    $imgArr[] = $this->processImages( $file, $largeUpload, $thumbUpload );		
  }
}

function processImages( $file, $pathLarge, $pathThumb ){
  $handle = new Upload($file);
  if ($handle->uploaded) {
    $handle->mime_check           = false;
    $handle->mime_magic_check     = false;

    /* Large */
    $handle->file_new_name_body   = $handle->file_src_name_body;
    if( $handle->image_src_x > 1200 ){
      $handle->image_resize         = true;
      $handle->image_x              = 1200;
      $handle->image_ratio_y        = true;
    }
    $handle->process($pathLarge);
				
    /* Thumnail */
    $handle->file_new_name_body   = $handle->file_src_name_body;
    $handle->image_resize         = true;
    $handle->image_x              = 150;
    $handle->image_ratio_y        = true;
    $handle->process($pathThumb);

    if ($handle->processed) {			
      return $handle->file_dst_name;				  
      $handle->clean();
    } else {
      return 'error : ' . $handle->error;
    }
  }
}
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