Uploading problems

See all posts See thread Reply

Re: Uploading problems new!
by Richard, 17 years, 10 months ago
Thanks for your attention...

The code is below. I notice that the $_FILES['binFile'][size] always returns 0 on files larger than about 750 to 800 Kb. but it is correct on files smaller.

The php.ini settings are
max_execution_time = 60
memory_limit = 32M
post_max_size = 16M
upload_max_filesize = 4M

My code:
$upload = new upload($_FILES['binFile']);
$upload->file_max_size = 4096;
if ($upload->uploaded) {
  $upload->allowed = array('image/jpeg','image/pjpeg','image/jpg','image/gif','image/png');
  $upload->image_convert        = 'jpg';
  $upload->file_new_name_body = $record;
  $upload->image_resize         = true;
  $upload->image_x              = $full_width;
  $upload->image_ratio_y        = true;
  $upload->process($img_basedir.'/full/');
  if ($upload->processed) {
    echo 'Full Image Resized';
    $success = 1;
  } else {
    echo 'Error : ' . $upload->error;
  }
  echo $upload->log;
}

Regards!Reply
Re: Uploading problems new!
by colin, 17 years, 10 months ago
I notice that the $_FILES['binFile'][size] always returns 0 on files larger than about 750 to 800 Kb. but it is correct on files smaller.

That leads me to think that there is a problem with your setup of PHP. The class only reads what is in $_FILES. If the information is not correct, it will assume that the upload is not good. In fact, if the size value is 0, it means that the upload wasn't successful, for some reason.

Does your code work on another server?Reply