title: upload file from angular2 using web api 2 c#
body: <p>I want to upload a file from Angular2 to Web Api 2. As simple as possible. </p>
  
  <p>I cannot really quite understand the type of objects that I have to use. </p>
  
  <pre><code>[HttpPost]
  [ResponseType(typeof(IEnumerable&lt;Attachment&gt;))]
  [SwaggerResponse(HttpStatusCode.OK, Type = typeof(IEnumerable&lt;Attachment&gt;))]
  public HttpResponseMessage UploadZip(FormData vale)
  {
  }
  </code></pre>
  
  <p>Problem is : </p>
  
  <blockquote>
    <p>FormData is unknown with a red underline.</p>
  </blockquote>
  
  <p>Angular: </p>
  
  <pre><code>fileChange(event) {
      debugger;
      let fileList: FileList = event.target.files;
      if (fileList.length &gt; 0) {
        let file: File = fileList[0];
        let formData: FormData = new FormData();
        formData.append('uploadFile', file, file.name);
        this.attachmentClient.uploadZip(formData).subscribe(result =&gt; console.log(result));
      }
    }
  </code></pre>
  
  <p>Html:</p>
  
  <pre><code>&lt;input type="file" (change)="fileChange($event)" placeholder="Upload file" accept=".pdf,.doc,.docx,.zip"&gt;
  </code></pre>
  
  <p>I really cannot understand the different types of File Objects and how to use them? if you can please Explain to me how it works and what to do to have this.</p>
  
  <p>P.S. I am using Swagger to create the services.</p>