Re: [PHP] Getting a binary file from URL

2001-04-23 Thread Christian Reiniger
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 (

Re: [PHP] Getting a binary file from URL

2001-04-22 Thread Sigitas Paulavicius
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

RE: [PHP] Getting a binary file from URL

2001-04-22 Thread Jaime Torres
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&#x

[PHP] Getting a binary file from URL

2001-04-22 Thread Jaime Torres
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