• Модуль: translate
  • Путь к файлу: ~/bitrix/modules/translate/lib/controller/asset/grabber.php
  • Класс: BitrixTranslateControllerAssetGrabber
  • Вызов: Grabber::moveUploadedFile
private function moveUploadedFile($postedFile, $suffix = '.tar', $timeToLive = 3): bool
{
	if (
		isset($postedFile['tmp_name']) &&
		file_exists($postedFile['tmp_name'])
	)
	{
		/** @var TranslateIOFile $tmpFile */
		$tmpFile = TranslateIOFile::generateTemporalFile('translate', $suffix, $timeToLive);
		if (@copy($postedFile['tmp_name'], $tmpFile->getPhysicalPath()))
		{
			$this->archiveFileType = $suffix;
			$this->archiveFilePath = $tmpFile->getPhysicalPath();
			return true;
		}
	}

	$this->addError(new MainError(Loc::getMessage('TR_IMPORT_EMPTY_FILE_ERROR')));

	return false;
}