title: unwrap string from Mono<String>
body: <p>I have a service that serve the uploading picture to server. I used Java Spring Reactive on this service, I rename the file with dateformat and need to return this new name. This is what i do in my service :</p>
  
  <pre><code>@Override
  public Mono&lt;String&gt; createImage(Flux&lt;FilePart&gt; files) {
      Date date = new Date();
      SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH-mm-ss");
      final String[] fileName = {""};
  
      return files.flatMap(file -&gt; {
          Mono&lt;Void&gt; copyFile = Mono.just(Paths.get(UPLOAD_ROOT, dateFormat.format(date) + "." + FilenameUtils.getExtension(file.filename())).toFile())
                  .log("createImage-picktarget").map(destFile -&gt; {
                      try {
                          fileName[0] = dateFormat.format(date) + "." + FilenameUtils.getExtension(file.filename());
                          destFile.createNewFile();
                          return destFile;
                      } catch (IOException ioe) {
                          throw new RuntimeException(ioe);
                      }
                  }).log("createImage-newFile").flatMap(file::transferTo).log("createImage-copy");
  
          return Mono.when(copyFile).log("createImage-when");
      }).log("createImage-flatMap").then(Mono.just(fileName[0])).log("createImage-done");
  }
  </code></pre>
  
  <p>this code return Mono to my controller. In this controller i need to return the String in Mono to the client because this string contain the new uploaded filename that needed in the frontend. This is my controller :</p>
  
  <pre><code>@PostMapping(value = "/upload")
  public Mono&lt;String&gt; createFile(@RequestPart(name = "file")Flux&lt;FilePart&gt; files){
      Mono&lt;String&gt; saveImage = nasabahService.createImage(files);
  
      return saveImage.flatMap(value -&gt; Mono.just(value));
  
  }
  </code></pre>
  
  <p>My question is, how can I get the String from Mono that returned by createImage function so I can send it to the client? </p>
  
  <p>Thanks for your help.</p>