I have looked at several of the functions and tried a few tutorials online
but am not having much luck for some reason resizing images.  I have this
code which works fine but everytime I try to add some resizing code, I get
the error that the image is not a valid image resource.  I have even
hardcoded the values to an image I know exists and get the same error.  I
would like to resize the images on upload to 250 wide but nothing seems to
work.

$upload_dir = "../images/property_$id";
  //When REGISTERED_GLOBALS are off in php.ini
  $_POST    = $HTTP_POST_VARS;
  $_GET     = $HTTP_GET_VARS;

  //Upload the file
    if($_GET['method'] == "upload")
    {

      $file_array = $HTTP_POST_FILES['file'];
      $_SESSION['message'] = "";
      $uploads = false;
      for($i = 0 ; $i < $files_to_upload; $i++)
      {
        if($_FILES['file']['name'][$i])
        {
          $uploads = true;
          if($_FILES['file']['name'][$i])
          {
            $file_to_upload = $upload_dir."/".$_FILES['file']['name'][$i];
            $thisName=$_FILES['file']['name'][$i];
                        $sql->query("update properties set
main_thumb='$thisName' where id=$id and main_thumb is null");

move_uploaded_file($_FILES['file']['tmp_name'][$i],$file_to_upload);
            chmod($file_to_upload,0777);
            //  add image resize
              $_SESSION['message'] .= $_FILES['file']['name'][$i]."
uploaded.<br>";
          }
        }
      }
      if(!$uploads)  $_SESSION['message'] = "No files selected!";
    }

Thanks,
Eddie

 WARNING:  The information contained in this message and any attachments is
intended only for the use of the individual or entity to which it is
addressed.  This message may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  It may also
contain trade secrets and other proprietary information for which you and
your employer may be held liable for disclosing.  You are hereby notified
that any unauthorized dissemination, distribution or copying of this
communication is strictly prohibited.  If you have received this
communication in error,  please notify [EMAIL PROTECTED] by E-Mail and then
destroy this communication in a manner appropriate for privileged
information.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to