function encode_file ($path, $encoding = "base64") {
      if(!@$fd = fopen($path, "rb"))
      {
         $this->error_handler(sprintf("File Error: Could not open file %s", $path));
         return false;
      }
      $file = fread($fd, filesize($path));
      $encoded = $this->encode_string($file, $encoding);
      fclose($fd);

      return($encoded);
   }