I look everywhere for the past two days and try my best, but still can't get it to work. I feel this should be a relatively simple task.
All I want to do is upload 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 everything is said and done, I want 1306495040_Number_Blink_1.1.1.apk in /www/downloads/
I tried the copy() function, I 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!
Corey source share