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

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

	return false;
}