This is a code to test a file type and upload file.Problem is:all the jpg file can not upload. but gif files can be upload.Can you tell me why?I really aprecaite this.
if( is_uploaded_file($file_array['tmp_name'])&&( $type=="image/gif" || $type=="image/jpg" ) )
{
$tmpname=$HTTP_POST_FILES['UploadPic']['tmp_name'];
$name=$HTTP_POST_FILES['UploadPic']['name'];
move_uploaded_file($tmpname,"$file_dir/".$name)or die("couldn't copy");
print"<img src=\"$file_url/$name\"><br>";
print "<b>Picture name:</b>$uname";
}
else{ print"can't upload";}