Reputation: 8523
i have to download a file created from a php script.
i tried this:
fopen('www.example.com/download.php?key=value', 'rb');
but i stille get a "failed to open stream" error.
how can i do that? If I browse to the url i get the file without problems...
EDIT: sorry, i forgot a piece of the string :)
Upvotes: 0
Views: 5512
Reputation: 44346
I see multiple issues with you request:
'r'
applies because you only want to read.phpinfo()
and look if allow_url_fopen
is set to On
.fclose
if you decide to use fopen
.Example:
$data = file_get_contents('http://www.example.com/download.php?key=value');
You should also read about fopen in the Manual.
Upvotes: 5
Reputation: 20475
It looks like you need to read the usage for fopen
first, here is an example usage:
fopen ("http://www.example.com/", "r");
r = read, that might be causing your failure.
Upvotes: 0