• Модуль: disk
  • Путь к файлу: ~/bitrix/modules/disk/lib/bitrix24disk/uploadfilemanager.php
  • Класс: BitrixDiskBitrix24DiskUploadFileManager
  • Вызов: UploadFileManager::rollbackByToken
public function rollbackByToken()
{
	if(!$this->hasToken())
	{
		$this->errorCollection->addOne(
			new Error(
				"Could not delete content file by token. Have to set token parameter.",
				self::ERROR_EMPTY_TOKEN
			)
		);
		return false;
	}
	$tmpFile = $this->findUserSpecificTmpFileByToken();
	if(!$tmpFile)
	{
		$this->errorCollection->addOne(
			new Error(
				"Could not find file by token",
				self::ERROR_UNKNOWN_TOKEN
			)
		);
		return false;
	}
	$success = $tmpFile->delete();
	if(!$success)
	{
		$this->errorCollection->add($tmpFile->getErrors());
	}

	return $success;
}