I have an account with hostinger and I want to upload an image through a web services with php I see that the image goes to the database but it is not recorded in the root folder of the hosting. I attach my php code which is very simple
<?php
$cnx=new PDO("mysql:host=mysql.hvbnvr.com;dbname=u1fhghfh","u17gfhfggft","I0@hfghfghfghfghFy");
$nombre=$_POST["nombre"];
$imagen=$_POST["imagen"];
$server_ip = gethostbyname(gethostname());
$path="dacepsacgde.com/solicitudfalta/$nombre.jpg";
file_put_contents("$path", base64_decode($imagen));
$bytesArchivo=file_get_contents($path);
$res=$cnx->query("insert into solicitudfaltas values(null,'file_get_contents($imagen)')");
if($res > 0){
echo "success";
}else{
echo "failed";
}
?>
The problem is that if you save in the database but not in the server. I already give all the permissions that hostinger gives me if someone can help me with this topic I would appreciate it a lot.