public static function saveFile($file, string $uploadsFolderPath) {
    if (!empty($file) && is_array($file) && !empty($uploadsFolderPath)) {
      $fileName          = $file['name'];
      $temporaryFileName = $file['tmp_name'];

      if (GeneralUtility::verifyFilenameAgainstDenyPattern($fileName)) {
        $uploadsFolderPath   = GeneralUtility::getFileAbsFileName($uploadsFolderPath);
        $fileName            = self::cleanFileName($fileName);
        $newFileName         = self::getUniqueFileName($fileName, $uploadsFolderPath);
        $fileCouldBeUploaded = GeneralUtility::upload_copy_move($temporaryFileName, $newFileName);

        if ($fileCouldBeUploaded) {
          return $newFileName;
        }
      } else {
        throw new InvalidFileNameException('File name could not be verified against deny pattern.', 1496958715);
      }
    }

    return null;
  }