I am trying to upload an img to a folder but I get an error, I do not know if it is the fault of the xampp or what the problem may be I have looked at posted errors but none of them have worked or I have not been able to apply them: /
<?php
if( $_POST ){
//ss
extract( $_POST, EXTR_OVERWRITE );
if (!file_exists("fotos")){
mkdir ( "fotos","0777");
}
$nombre = strtolower($nombre);
$dirSubida = $_SERVER['DOCUMENT_ROOT']."/fotos/$nombre/";
if ( !file_exists ("fotos")){
mkdir( $dirSubida, 0777);
}
$foto = $_FILES['foto'];
$nombreFoto = $foto['name'];
$nombreTmp = $foto{'tmp_name'};
$rutaSubida = "{$dirSubida}profile.jpg";
$extArchivo = preg_replace('/image\//', '', $foto['type']);
if ($extArchivo == 'jpeg' || $extArchivo == 'png'){
if ( move_uploaded_file ($nombreTmp, $rutaSubida)){
echo "<img class='img-responsive' src='$rutaSubida' alt=''>";
}
}
}
?>
This is the error:
Warning: move_uploaded_file (C: /xampp/htdocs/fotos/qwe/profile.jpg): failed to open stream: No such file or directory in C: \ xampp \ htdocs \ backend \ register.php on line 39
Warning: move_uploaded_file (): Unable to move 'C: \ xampp \ tmp \ php17A8.tmp' to 'C: /xampp/htdocs/fotos/qwe/profile.jpg' in C: \ xampp \ htdocs \ backend \ register.php on line 39