title: Upload file using React frontend app and Spring (Java) backend app
body: <p>I have a project uses Java's Spring as backend and React as frontend and I want to upload a file to the server.
  In the backend, I have a Spring controller with the following method:</p>
  
  <pre><code>@RequestMapping("/upload-file")
  public void uploadFile (MultipartHttpServletRequest multipartHttpServletRequest) {
      //save on server logic comes here
  }
  </code></pre>
  
  <p>On frontend, I want to use some npm library to upload the file. 
  The problem is that non of the libraries I found sends the file in a way Spring controller can handle. 
  Maybe I'm missing something: What is the best way to upload a file from react frontend to Spring backend? </p>