• Модуль: socialnetwork
  • Путь к файлу: ~/bitrix/modules/socialnetwork/lib/integration/main/file.php
  • Класс: BitrixSocialnetworkIntegrationMainFile
  • Вызов: File::getFileSource
static function getFileSource(
	int $fileId,
	int $width = 50,
	int $height = 50,
	bool $immediate = false
): string
{
	if ($fileId <= 0)
	{
		return '';
	}

	if ($file = CFile::GetFileArray($fileId))
	{
		$fileInfo = CFile::ResizeImageGet(
			$file,
			[
				'width' => $width,
				'height' => $height,
			],
			BX_RESIZE_IMAGE_EXACT,
			false,
			false,
			$immediate
		);

		return $fileInfo['src'];
	}

	return '';
}