sql >> Database teknologi >  >> RDS >> Mysql

Upload flere filer til serveren med php, der ikke uploader alle filer til serveren

move_uploaded_file returnerer true ved succes, de resterende else, hvis aldrig nås. Prøv noget som dette:

$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. Kunne ikke konvertere fra typen [java.lang.Object[]] til typen [@org.springframework.data.jpa.repository.Query

  2. Hvad betyder det, når en PostgreSQL-proces er inaktiv i transaktionen?

  3. Lagring af id'er som kommaseparerede værdier

  4. PDO::ERRMODE_EXCEPTION undertrykker ikke advarsler