• Модуль: webdav
  • Путь к файлу: ~/bitrix/modules/webdav/classes/webdavtmpfile.php
  • Класс: CWebDavTmpFile
  • Вызов: CWebDavTmpFile::internalAppendNonCloud
private function internalAppendNonCloud(CWebDavTmpFile $file, $startRange, $endRange, $fileSize)
{
	if(!$this->existsFile())
	{
		throw new WebDavTmpFileErrorException('Append content. Not exists file (target)');
	}
	if(!$file->existsFile())
	{
		throw new WebDavTmpFileErrorException('Append content. Not exists file');
	}
	$fp = fopen($this->getAbsolutePath(), 'ab');
	if(!$fp)
	{
		throw new WebDavTmpFileErrorException('Could not open file');
	}
	$appendContent = $file->getContent();
	if($appendContent === false)
	{
		throw new WebDavTmpFileErrorException('Could not get contents file (target)');
	}
	if(fwrite($fp, $appendContent) === false)
	{
		throw new WebDavTmpFileErrorException('Error in fwrite (append)');
	}
	fclose($fp);

	return true;
}