|  | Posted by macca on 08/13/07 23:51 
Hi thanks for the quick reply.
 You are right. it was the "type" causing it. I used print_r and it
 gave me this:
 
 Array ( [file] => Array ( [name] => DSCF0495.JPG [type] => image/pjpeg
 [tmp_name] => C:\WINDOWS\TEMP\php11.tmp [error] => 0 [size] =>
 115829 ) )
 
 The type was coming out as "image/pjpeg" for some reason.
 
 
 I changed it to this and it now works fine. Thanks.
 
 
 if(is_uploaded_file($_FILES['file']['tmp_name']))
 {
 print_r($_FILES);
 $img_mime_type = getimagesize($_FILES['file']
 ['tmp_name']);
 if(
 ($img_mime_type[2] == IMAGETYPE_GIF) ||
 ($img_mime_type[2] == IMAGETYPE_JPEG)||
 ($img_mime_type[2] == IMAGETYPE_PNG)
 )
 {   //200kb
 move_uploaded_file($_FILES['file']
 ['tmp_name'],$uploaddir.'/'.$_FILES['file']['name']);
 $current_file_uploaded = $_FILES['file']
 ['name'];
 $picture_name = $current_file_uploaded;
 
 //CREATE THUMBNAIL OF UPLOADED IMAGE
 ========================= JPG PNG
 //createthumb($uploaddir.'/'.
 $current_file_uploaded,$uploaddir.'/thumbs/thumb_'.
 $current_file_uploaded,150,150);
 } else {
 die('You may only upload file types
 JPEG/JPG, PNG or GIF.');
 }
 
 }
 
 
 Regards,
 
 Paul
 [Back to original message] |