code: public static File saveToTempFile(Part part) throws IOException {
      String filename = getOriginalFileName(part);
      if (filename == null) {
        return null;
      }
  
      File file = File.createTempFile("molgenis-", "." + StringUtils.getFilenameExtension(filename));
      FileCopyUtils.copy(part.getInputStream(), new FileOutputStream(file));
  
      return file;
    }
docs: Saves an uploaded file to a tempfile with prefix 'molgenis-', keeps the original file extension
  
  @return the saved temp file or null is no file selected