I am downloading image from url using php. here is my code
$filenameIn = $_POST['url'];
$contentOrFalseOnFailure = file_get_contents($filenameIn);
$byteCountOrFalseOnFailure = file_put_contents($filenameOut, $contentOrFalseOnFailure);
Its works fine. Now problem is that my image url is on my live server for example website name is www.umair.com and image address is www.umair.com/image.jpg now file_get_contents($filenameIn) is not working.
Error is:
Warning: file_get_contents(www.umair.com/image.jpg): failed to open stream: No such file or directory in
http://Here's a quick fix$filenameIn = "http://" .$_POST['url'];