title: Accepting List<MultipartFile> files from Angular
body: <p>I'm experiencing issue with sending multiple files from angular front-end to spring-boot backend. I've tried everything from stack and from net but i couldn't find the answer. Here's my code:</p>
  
  <p>Angular:
  .ts file:</p>
  
  <pre><code>  submit(){
      this.uploadedFiles = this.uploadedFiles.map(item =&gt; {
        let formData = new FormData();
        return formData.append('file',item,item.name);
      });
      this.service.postFile(this.uploadedFiles).subscribe(result =&gt; {
        console.log(result);
      })
    }
  </code></pre>
  
  <p><strong>this.uploadedFiles is somehow undefined of type FormData ?</strong></p>
  
  <p><a href="https://i.stack.imgur.com/iVqez.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iVqez.png" alt="enter image description here"></a></p>
  
  <p>service file:</p>
  
  <pre><code>postFile(files: any): Observable&lt;string&gt;{
        return this.http.post('/id/file', files, {responseType:'text'});
    }
  </code></pre>
  
  <p>spring controller:</p>
  
  <pre><code>    @PostMapping(value = "/file")
  private String newFile(@RequestBody List&lt;MultipartFile&gt; mf) {
      return "error";
  }
  </code></pre>
  
  <p>inside of debugger i've got null for mf list.</p>
  
  <p>The main issue is that for 1 file (when I'm using only MultipartFile) mine code is working.</p>
  
  <p>I'm using PrimeNG's p-fileupload with custom upload event.</p>