• Модуль: disk
  • Путь к файлу: ~/bitrix/modules/disk/lib/controller/attachedobject.php
  • Класс: BitrixDiskControllerAttachedObject
  • Вызов: AttachedObject::downloadAction
public function downloadAction(DiskAttachedObject $attachedObject)
{
	$file = $attachedObject->getFile();
	if (!$file)
	{
		$this->addError(new Error('Could not find file'));

		return;
	}

	$response = ResponseBFile::createByFileId($file->getFileId(), $attachedObject->getName());
	$response->setCacheTime(DiskConfiguration::DEFAULT_CACHE_TIME);

	return $response;
}