PHP interesse | 
                 | 
                
				
				Heel vaag, want soms doen mijn uploads het niet en de andere keer weer wel. 
 
mijn form is natuurlijk wel enctype='multipart/form-data' 
hij geeft dan de error aan: 
De foto is geen .jpg, het was een 1 
Soms werken de hoogte/breedte chekcs ook niet 
 
hier is mijn stukje code: 
    
    
        
            
                
<?php
$Foto_Maxbreedte = 500;
$Foto_Maxhoogte = 500;
$Foto_Maxbytes = 500000;
$Foto_Kb_Maxbytes = ($Foto_Maxbytes / 1000 );
if (!is_uploaded_file($_FILES['Crew_Foto']['tmp_name'])) {
	echo ("<font color='#FF0000'>Geen foto</font><br>");
	$Error = 1;
} else {
	$Foto_Grootte = getimagesize($_FILES['Crews_Foto']['tmp_name']);
	$Foto_Breedte = $Foto_Grootte[0];
	$Foto_Hoogte  = $Foto_Grootte[1];
	
	$Foto_Bestandsnaam    = $_FILES['Crew_Foto']['name'];
	$Foto_Delen           = explode (".", $Foto_Bestandsnaam);
	$Foto_Extensie        = strtoupper($Foto_Delen[1]);
	$Foto_Bestandsgrootte = $_FILES['Crew_Foto']['size'];
	
	if ($Foto_Extensie != "JPEG" && $Foto_Extensie != "JPG") {
		echo ("<font color='#FF0000'>De foto is geen .jpg, het was een $Foto_Extensie !</font><br>");
		$Error = 1;
	}
	if ($Foto_Breedte > $Foto_Maxbreedte) {
		echo ("<font color='#FF0000'>De foto is breder dan $Foto_Maxbreedte pixels !</font><br>");
		$Error = 1;
	}
	if ($Foto_Hoogte > $Foto_Maxhoogte) {
		echo ("<font color='#FF0000'>De foto is hoger dan $Foto_Maxhoogte pixels !</font><br>");
		$Error = 1;
	}
	if ($Foto_Bestandsgrootte > $Foto_Maxbytes) { 
		echo ("<font color='#FF0000'>De foto is groter dan $Foto_Maxbyteskb Kb !</font><br>");
		$Error = 1;
	}
}
?>
             
            <?php $Foto_Maxbreedte = 500; $Foto_Maxhoogte = 500; $Foto_Maxbytes = 500000; $Foto_Kb_Maxbytes = ($Foto_Maxbytes / 1000 );   	echo ("<font color='#FF0000'>Geen foto</font><br>"); 	$Error = 1; } else { 	$Foto_Grootte = getimagesize($_FILES['Crews_Foto']['tmp_name']); 	$Foto_Breedte = $Foto_Grootte[0]; 	$Foto_Hoogte  = $Foto_Grootte[1];   	$Foto_Bestandsnaam    = $_FILES['Crew_Foto']['name']; 	$Foto_Delen           = explode (".", $Foto_Bestandsnaam); 	$Foto_Bestandsgrootte = $_FILES['Crew_Foto']['size'];   	if ($Foto_Extensie != "JPEG" && $Foto_Extensie != "JPG") { 		echo ("<font color='#FF0000'>De foto is geen .jpg, het was een $Foto_Extensie !</font><br>"); 		$Error = 1; 	} 	if ($Foto_Breedte > $Foto_Maxbreedte) { 		echo ("<font color='#FF0000'>De foto is breder dan $Foto_Maxbreedte pixels !</font><br>"); 		$Error = 1; 	} 	if ($Foto_Hoogte > $Foto_Maxhoogte) { 		echo ("<font color='#FF0000'>De foto is hoger dan $Foto_Maxhoogte pixels !</font><br>"); 		$Error = 1; 	} 	if ($Foto_Bestandsgrootte > $Foto_Maxbytes) {  		echo ("<font color='#FF0000'>De foto is groter dan $Foto_Maxbyteskb Kb !</font><br>"); 		$Error = 1; 	} } ?> 
 
  
         
          
     
  				
				 |