Re: Best way to recieve image from url?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> ...

You could read it progressively using fopen(), fread() et al.
Probably. This would mean only a small amount of data is read by yours
erver at once. Eg:

$rp = fopen('http:www.example.com/title.png', 'r');
$wp = fopen('mylocalfile', 'w');

while ($block = fread($rp, 8192)) { // 8k block size
    fwrite($wp, $block);
}

fclose($rp);
fclose($wp);

>From memory. Something like that. Fopen() modes may need tweaking.

-- 
Richard Heyes

HTML5 Graphing for FF, Chrome, Opera and Safari:
http://www.rgraph.org

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux