Reply to Re: Crashing after instantiation

Re: Crashing after instantiation new!
by Tim, 10 years, 6 months ago
I'm having a very confusing problem; the script crashes right after instantiation. I'm working with a very small jpg (33k) to make sure it isn't a memory issue. Nothing is being reported in the error logs either. So I created a simple testupload.php script to see if there's a permissions issue, etc. and THAT works.

I've removed the upload and security checks from the code below to just show the relevant parts.

// this doesn't work
$handle = new Upload($_FILES['photo']);
if($handle->uploaded) {
  $handle->file_new_name_body = $hash;
  $handle->file_overwrite = true;
  $handle->image_resize 	= false;
  $handle->process('/srv/wt/htdocs/admin/uploadtest/');
  if($handle->processed) {
    $handle->clean();
  } else {
    $form->add_to_errors($handle->error);
  }
  $photo = $hash.'.'.$handle->file_src_name_ext;
}

// but this does
move_uploaded_file($_FILES["photo"]["tmp_name"],"/srv/wt/htdocs/admin/uploadtest/" . $_FILES["photo"]["name"]);
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