I try to insert images in my database with PHP and MySQL with a temporary folder.
I use laravel and this is my controller:
if(isset($_FILES['img_masc']))
{
$img=$_FILES['img_masc']['name'];
$ruta= $_FILES['img_masc']['tmp_name'];
}
$destino='../../../Perf_Masc/'.$img;
$masc->img=$destino;
//copy($ruta, $destino);
move_uploaded_file($ruta, $destino); //line 49
This is my view:
<form method="POST" action="/RegMasc" enctype= "multipart/form-data" >
<div>
<input required name="img_masc" type="file"/>
</div>
This is my error:
ErrorException in line 49: move_uploaded_file(../../../Perf_Masc/AF5.jpg): failed to open stream: No such file or directory
I try with so much things and also with the copy function and is not working anyway