sql >> Database >  >> RDS >> Mysql

Upload meerdere bestanden naar de server waarbij php niet alle bestanden naar de server uploadt

move_uploaded_file retourneert true bij succes, de overige elseif wordt nooit bereikt. Probeer zoiets als dit:

$error = false;

if(move_uploaded_file($_FILES['photo']['tmp_name'], $target))  
{   
echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded, and your information has been added to the directory";  
} else $error = true;

if(move_uploaded_file($_FILES['photo1']['tmp_name'], $target1))  
{   
echo "The 2 file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded, and your information has been added to the directory";  
} else $error = true; 

if(move_uploaded_file($_FILES['photo2']['tmp_name'], $target2))  
{   
echo "The 3 file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded, and your information has been added to the directory";  
} else $error = true;

if($error)
   echo "Sorry, there was a problem uploading your file.";



  1. Door de gebruiker gedefinieerde MySQL-variabelen in Laravel 3?

  2. Een IN-clausule gebruiken met MySQL met opgegeven waarden

  3. Verdeel gegevens in kolommen in mysql

  4. Tijdstempel converteren met milliseconden tot nu toe in Oracle