• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/web/webpacker/output/file.php
  • Класс: Bitrix\Main\Web\WebPacker\Output\File
  • Вызов: File::saveFile
protected function saveFile($content)
{
	$this->remove();

	$type = $this->type;
	if (!$type && $this->name)
	{
		$type = static::getMimeTypeByFileName($this->name);
	}

	$fileArray = [
		'MODULE_ID' => $this->moduleId,
		'name' => $this->name,
		'content' => $content
	];

	if ($type)
	{
		$fileArray['type'] = $type;
	}

	$this->id = \CFile::SaveFile(
		$fileArray,
		$this->moduleId,
		false,
		false,
		$this->dir ?: ''
	);

	return $this->id;
}