file_put_contents does not save me on the server

0
file_put_contents($filepath,$imagen);

does not save me in my hosting server, but in my computer directory if I insert the corresponding path. What could he not have done to keep me on the server?

    
asked by JoelRomero 07.07.2018 в 21:47
source

1 answer

0

I found the solution on this page: link my mistake was that

$filepath = "http://www.example.com/AfuncServidor/imagenes/".$nombreFoto;

when it should be:

$filepath =  $_SERVER['DOCUMENT_ROOT'] ."/AfuncServidor/imagenes/".$nombreFoto

That was my mistake, thank you very much to all and I hope you will serve this info to other novices like me: D: D

    
answered by 08.07.2018 в 21:37