• Модуль: disk
  • Путь к файлу: ~/bitrix/modules/disk/lib/bitrix24disk/tmpfile.php
  • Класс: BitrixDiskBitrix24DiskTmpFile
  • Вызов: TmpFile::appendContentNonCloud
private function appendContentNonCloud($fileContent, $startRange, $endRange, $fileSize)
{
	$file = new IOFile($this->getAbsolutePath());
	if(!$file->isExists())
	{
		$this->errorCollection->addOne(
			new Error(
				'Could not find file',
				static::ERROR_EXISTS_FILE
			)
		);

		return false;
	}

	if ($file->getSize() == ($endRange+1))
	{
		//we already have this portion of content. Seems to be like that
		return true;
	}

	if($file->putContents($fileContent, $file::APPEND) === false)
	{
		$this->errorCollection->addOne(
			new Error(
				'Could not put contents to file',
				static::ERROR_PUT_CONTENTS
			)
		);

		return false;
	}

	return true;
}