Reply to Re: Assigning source image's filename to PHP variable

Re: Assigning source image's filename to PHP variable new!
by NightMICU, 14 years ago
I'm not sure how to do that. Here is the PHP I am trying to get to work...
$handle = new upload($_FILES['photo']);
if ($handle->uploaded) {
  $handle->file_new_name_body   = $filename;
  $handle->file_auto_rename = true;
  $handle->image_resize         = true;
  $handle->image_x              = 400;
  $handle->image_y        = 400;
  $handle->image_ratio          = true;
  $handle->image_convert = 'jpg';
  $handle->jpeg_quality = 95;
  $handle->process('../../../gallery/photos');
  $handle->file_new_name_body   = $filename . "_thumb";
  $handle->file_auto_rename = true;
  $handle->image_resize         = true;
  $handle->image_x              = 120;
  $handle->image_y        = 120;
  $handle->image_ratio          = true;
  $handle->image_convert = 'jpg';
  $handle->jpeg_quality = 95;
  $handle->process('../../../gallery/photos/thumbs');
  if ($handle->processed) {
    $photo = $handle->file_dst_name_body;
    $handle->clean();
    $addPhotoSql = "INSERT INTO images (caption, filename, album) VALUES ('$caption', '$photo', '$albumTitle')";
    $addPhoto = mysql_query($addPhotoSql) or die(mysql_error());
    header('Location: display_album.php?album=' . $url . "#thumbs");
    } else {
      echo '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