• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/http.php
  • Класс: CHTTP
  • Вызов: CHTTP::Download
public function Download($url, $file)
{
	if (is_resource($file))
	{
		$this->fp = $file;
	}
	else
	{
		CheckDirPath($file);
		$this->fp = fopen($file, "wb");
	}

	if(is_resource($this->fp))
	{
		$res = $this->HTTPQuery('GET', $url);

		if (!is_resource($file))
		{
			fclose($this->fp);
			$this->fp = null;
		}

		return $res && ($this->status == 200);
	}
	return false;
}