title: File upload problem. In what form to send data to API
body: <p>Prompt, I have a problem uploading files to the database. I need to implement a controller that accepts a number of files from 1 to n with additional parameters.
  For example:</p>
  <pre><code>public class FilesDTO{
    private String name;
  
  
      private String type;
  
      private MultipartFile file;
  
  get / get 
  }
  </code></pre>
  <p>further implement the controller, for example:</p>
  <pre><code> @RequestMapping(value = &quot;file/{id}&quot;, method = RequestMethod.POST, consumes = { MediaType.APPLICATION_JSON_VALUE,
              MediaType.MULTIPART_FORM_DATA_VALUE })
      public ResponseEntity&lt;?&gt; addFile(@PathVariable Long id, @ModelAttribute List&lt;FilesDTO&gt; filesRequestList) throws IOException {
  
        // log..
  
      }
  </code></pre>
  <p>how to send a request correctly and in what form to this controller?</p>
  <p>If you use postman.
  maybe I misunderstood how to implement the controller, tell me how best to do
  maybe this should be done not through dto</p>