Re: Getting a binary file from URL
| From: | Christian Reiniger | Date: | Mon, 23 Apr 2001 14:18:17 +0000 |
| Subject: | Re: Getting a binary file from URL | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-49855@lists.php.net to get a copy of this message | ||
On Sunday 22 April 2001 21:25, Sigitas Paulavicius wrote:
> Solution #1
>
> $contents = fread ($pointer, 1000000000000);
>
>
>
> Solution #2
>
> $contents="";
> while ($partial = fread ($pointer, 8192)) {
> $contents.=$partial;
> };
But test this before you rely on it. I once did this with (IIRC) PHP
4.0.1 and it read up to several hundred junk bytes after encountering EOF.
--
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)
"World domination. Fast." (Linus Torvalds about Linux)