|
|
 |
Re: FN-FORUM: Opening remote files with PHP
date posted 16th August 2006 17:03
Ben Moxon wrote:
>
>
>
> Steven Lavine wrote:
>
>>
>> Ben Moxon wrote:
>>
>>>
>>> Steven Lavine wrote:
>>>
>>>>
>>>> I'm trying to open a remote image file and save it locally in a php
>>>> script. The following code keeps failing though. Has anyone got any
>>>> advice?
>>>>
>>>> $image_handle = fopen("http://www.example.com/foo.jpg", 'rb');
>>>> $content = stream_get_contents($image_handle);
>>>> fclose($image_handle);
>>>>
>>>> $handle = fopen("foo.jpg", 'a');
>>>> fwrite($handle,"$content\n");
>>>> fclose("foo.jpg");
>>>>
>>> Looks like the very helpful man knows a lot about that:
>>> http://uk.php.net/fopen
>>>
>>> -ben
>>>
>>>
>> Ben,
>>
>> I have tried the examples shown on that page. but nothing is returned.
>>
>> Steven
>
> Is there a way you can test it between two servers you have access to,
> so that you can see what is going on in the logs?
>
> -ben
>
Hi Ben,
The remote server does not receive any requests from the script that I'm
running. I think it's a firewall issue at the local end. DoH! Thanks for
your assistance.
Steven
|
 |
|