• Модуль: webdav
  • Путь к файлу: ~/bitrix/modules/webdav/classes/file.php
  • Класс: CWebDavFile
  • Вызов: CWebDavFile::GET
function GET(&$options)
{
	$io = self::GetIo();
	if (count($this->arParams) <= 0)
	{
		$this->IsDir($options);
	}
	if ($this->arParams["not_found"])
	{
		return false;
	}
	elseif ($this->arParams["is_dir"])
	{
		return true;
	}

	$fspath = $options["path"];
	//if (strpos($fspath, $this->real_path_full) === false)
	//{
		//$fspath = $this->arParams["item_id"];
		//$fspath = $io->CombinePath($this->real_path_full, $this->arParams["item_id"]);
	//}
	if (mb_strpos($fspath, $this->real_path_full) === 0)
	{
		$fspath = CWebDavBase::ConvertPathToRelative($fspath, $this->real_path_full);
	}
	$fspath = CWebDavBase::CleanRelativePathString($fspath, $this->real_path_full);
	if($fspath === false)
	{
		return false;
	}

	$oFile = $io->GetFile($fspath);

	$options["mimetype"] = $this->_mimetype($fspath);
	$options["mtime"] = $oFile->GetModificationTime() + CTimeZone::GetOffset();
	$options["size"] = $oFile->GetFileSize();
	$options["stream"] = $oFile->Open("rb");

	if (empty($options["mimetype"]))
		$options["mimetype"] = $this->get_mime_type($this->arParams["file_name"]);

	return true;
}