Justtechjobs.com Find a programming school near you






Online Campus Both


php-general | 2001092

[PHP] Re: Download a file with PHP From: _lallous (elias_bachaalany <email protected>)
Date: 09/17/01

Very simple,

you can use functions like this to copy file from an HTTP server to your
local harddrive:
  function my_copyfile($src, $dest)
  {
    if (!$fp = fopen($src, "rb"))
      return;
    $fpo = fopen($dest, "wb");
    while (!feof($fp))
    {
      $t = fread($fp, 4096);
      fwrite($fpo, $t, 4096);
    }
    fclose($fp);
    fclose($fpo);
  }

in combination with the use of RegExps to parse HTML pages and extract the
filenames that you want to extract....

"Erich Kolb" <ekolb <email protected>> wrote in message
news:000601c13d3b$3e0ba580$6b01a8c0 <email protected>
> How do I download a file with PHP? I have a few hundred .xml and .rdf
files
> that I want to download on a regular basis.
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe <email protected>
For additional commands, e-mail: php-general-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>