What I need is to save image on the remote server that is in a hosting:
$ruta= "C:/wamp64/www/AfuncServidor/imagenes/portadaFacebook.jpg";//aquí el problema que no entiendo.
$imagen = file_get_contents($ruta);
$nombreFoto = substr($ruta, strripos($ruta, "/")+1);
$filepath = $_SERVER['DOCUMENT_ROOT']."\AfuncServidor\imagenes\".$nombreFoto;
file_put_contents($filepath,$imagen);
when the $ path = to a computer path as in the previous one returns
PHP Warning: file_get_contents (C: /wamp64/www/AfuncServer/imagenes/portadaFacebook.jpg): failed to open stream: No such file or directory in ... (server.php file)
when:
$ruta= "https://www.solocruceros.com/blog/wp-content/uploads/2013/07/shutterstock_79826992.jpg";
works for me, and
$ruta = "https://lageografia.com/wp-content/uploads/rio-1.jpg";//tambien no me reconoce con este enlace
does not recognize me either
What could be the problem? What could not I have done?
PS: The idea is that in a .csv file there is a table of products with the path of the image in a column. This .csv file can be exported to a database and the previously exposed code is where it receives the path that is in the rows of the file table.csv, it creates the image and saves it in the server. I hope you understand me and help me, thank you very much.