[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-general
Subject:    Re: [PHP] Best way to recieve image from url?
From:       Børge_Holen <borge () arivene ! net>
Date:       2008-10-19 23:29:46
Message-ID: 70221D7D-AE23-44BD-8428-191D61143081 () arivene ! net
[Download RAW message or body]


On Oct 20, 2008, at 12:46 AM, Nitsan Bin-Nun wrote:

> Hi,
> I have this function:
>
>
>    function saveImageFromUrl($image_url, $image_save)
>    {
>        $contents = file_get_contents($image_url);
>
>        $fp = fopen($image_save, 'w');
>        fwrite($fp, $contents);
>        fclose($fp);
>    }
>
> As you can see it fetches the images contents and write them to new  
> image on
> my local directory.
> Is this is the best way to do this? (I don't have curl)
> Does file_get_contents() uses buffer to get the contents of the  
> image? (in
> case the server response is slow)

the server will respond slow either way if it is slow to respond.

>
> There is a better way?
>
> Thanks in Advance,
> Nitsan


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic