Date: 06/15/02
- Next message: John Holmes: "RE: [PHP] massive find/replace on MySQL db"
- Previous message: Daniel Tryba: "Re: [PHP] saving a jpeg via HTTP"
- In reply to: Daniel Tryba: "Re: [PHP] saving a jpeg via HTTP"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Sat, Jun 15, 2002 at 06:02:58PM +0200, Daniel Tryba wrote:
> This works for me:
Hmmm, one while(!feof()) to many.... not that it really matters :)
<?php
if($fi=fsockopen("host",80))
{
fputs($fi,"GET /image.gif HTTP/1.0\r\n\r\n");
while(!preg_match("/^\r?\n$/",fgets($fi,1024))); //skip headers
if($fo=fopen("/tmp/tmp.gif","w"))
{
while(!feof($fi))
{
fwrite($fo,fread($fi,65535));
}
fclose($fo);
}
fclose($fi);
}
?>
--Daniel Tryba
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
- Next message: John Holmes: "RE: [PHP] massive find/replace on MySQL db"
- Previous message: Daniel Tryba: "Re: [PHP] saving a jpeg via HTTP"
- In reply to: Daniel Tryba: "Re: [PHP] saving a jpeg via HTTP"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

