I've been looking all over the place for the last two days and trying everything and still can't get anything to work. I feel like this should be a relatively simple thing to do.
All I want to do is download a remote file from a URL to a directory on my server.
So, for example, if
$_url = http://www.freewarelovers.com/android/download/temp/1306495040_Number_Blink_1.1.1.apk
and $_dir = /www/downloads/
Then when all is said and done I want 1306495040_Number_Blink_1.1.1.apk
in /www/downloads/
I've tried the copy()
function, I've tried
file_put_contents("$_dir.$_file_name", file_get_contents($_url));
and get the following error:
file_get_contents(): failed to open stream: HTTP request failed!
it uses curl
$url is the file url
$path is where and the name to save the file
i hope it works