On Sunday 22 April 2001 21:25, Sigitas Paulavicius wrote:
> Solution #1
>
> $contents = fread ($pointer, 1);
>
>
>
> Solution #2
>
> $contents="";
> while ($partial = fread ($pointer, 8192)) {
> $contents.=$partial;
> };
But test this before you rely on it. I once did this with (
Solution #1
$contents = fread ($pointer, 1);
Solution #2
$contents="";
while ($partial = fread ($pointer, 8192)) {
$contents.=$partial;
};
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PR
x Mb.
Thanks,
Jaime
-Mensaje original-
De: Jaime Torres [mailto:[EMAIL PROTECTED]]
Enviado el: domingo 22 de abril de 2001 12:07
Para: [EMAIL PROTECTED]
Asunto: [PHP] Getting a binary file from URL
Hi, I'm trying to get a binary file from an URL and then save it to a local
disk.
I
Hi, I'm trying to get a binary file from an URL and then save it to a local
disk.
I'm trying this:
$fd = fopen ($filename, "rb");
$contents = fread ($fd, filesize ($filename));
fclose ($fd);
$fp = fopen ($tempfile, "wb");
fwrite ($fp,$contents);
fclose ($fp);
If I use $filename="local_file" th
4 matches
Mail list logo