core-bundle/src/Controller/BackendCsvImportController.php
private function getFiles(FileUpload $uploader): array
    {
        $files = $uploader->uploadTo('system/tmp');

        if (\count($files) < 1) {
            throw new \RuntimeException($this->translator->trans('ERR.all_fields', [], 'contao_default'));
        }

        foreach ($files as &$file) {
            $extension = pathinfo($file, PATHINFO_EXTENSION);

            if ('csv' !== $extension) {
                throw new \RuntimeException(
                    sprintf($this->translator->trans('ERR.filetype', [], 'contao_default'), $extension)
                );
            }

            $file = $this->projectDir.'/'.$file;
        }

        return $files;
    }
private function getFiles(FileUpload $uploader): array
    {
        $files = $uploader->uploadTo('system/tmp');

        if (\count($files) < 1) {
            throw new \RuntimeException($this->translator->trans('ERR.all_fields', [], 'contao_default'));
        }

        foreach ($files as &$file) {
            $extension = pathinfo($file, PATHINFO_EXTENSION);

            if ('csv' !== $extension) {
                throw new \RuntimeException(
                    sprintf($this->translator->trans('ERR.filetype', [], 'contao_default'), $extension)
                );
            }

            $file = $this->projectDir.'/'.$file;
        }

        return $files;
    }
Returns the uploaded files from a FileUpload instance.

@throws \RuntimeException

@return string[]