Mysql
 sql >> Base de données >  >> RDS >> Mysql

Télécharger plusieurs fichiers sur le serveur avec php ne téléchargeant pas tous les fichiers sur le serveur

move_uploaded_file renvoie true en cas de succès, les elseif restants ne sont jamais atteints. Essayez quelque chose comme ceci :

$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.";