While running the below code, a form passes the image name to this code, the values when executed are as follows: Step1: upload_file_type: Step1: upload_file: C:\\Documents and Settings\\jack.IISG\\Desktop\\BVP.jpg Step1: extention:
Step2: upload_file_type: Step2: upload_file: C:\\Documents and Settings\\jack.IISG\\Desktop\\BVP.jpg Step2: extention: image/pjpeg And what happens is it keeps giving me the following error: Not a Valid Image Extension, .jpg only! This is going to be something stupid that I am being blind to... any help appreciated! --------------- Code Below ------------------------------------ //The file to be uploaded global $upload_file_name; echo "Step1: upload_file_type: " . $upload_file_type ."<br>"; echo "Step1: upload_file: " . $upload_file."<br>"; echo "Step1: extention: " . $extention ."<br>"; if($upload_file !="") { //image size esle will ignore ... $img_max_width=750; $img_max_height=750; $extention= $file_type1 = "image/pjpeg"; $file_type2 = "image/jpeg"; $file_type3 = "image/gif"; $file_type4 = "image/jpg"; echo "Step2: upload_file_type: " . $upload_file_type ."<br>"; echo "Step2: upload_file: " . $upload_file."<br>"; echo "Step2: extention: " . $extention ."<br>"; if (($upload_file_type == $file_type1) or ($upload_file_type == $file_type2) or ($upload_file_type == $file_type3) or ($upload_file_type == $file_type4)) { $ext=strrchr($upload_file_name, ".");// $picture_name=get_param("first_name")."_".get_param("last_name"); $picture_name=str_replace(" ","_",$picture_name); $picture_name=explode(".",$picture_name); $upload_file_name=$picture_name[0]."".$ext; $image_url="images/contacts/".$upload_file_name; @copy($upload_file, "images/contacts/".$upload_file_name); chmod("images/contacts/".$upload_file_name,0777); $image_test_size = "images/contacts/".$upload_file_name; $image_size = getimagesize($image_test_size); $img_width = (($image_size[0])); $img_height = (($image_size[1])); if (($img_width > $img_max_width or $img_height > $img_max_height)) { unlink("images/contacts/".$upload_file_name); } } else { echo "Not a Valid Image Extension, .jpg only!"; } } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php