title: Angular and Nodejs: Sending image
body: <p>For my angular + nodejs app, I have following to upload image:</p>
  
  <p><strong>file.ts</strong></p>
  
  <pre><code> handleFileInput(files: FileList) {
      var filename = files.item(0);
      this.upload(filename).subscribe();
  };
  
  
  upload(fileToUpload: File){   
    console.log(fileToUpload); //Here I can see all the image data     
  
    let obj = {
          imageData: fileToUpload,
          imageID: "Sample"
    };
  
    return this.http.post&lt;any&gt;(url, obj ,{});
  }
  </code></pre>
  
  <p><strong>Then in nodejs, uploadController.js</strong></p>
  
  <pre><code>private initAPI(): void {
      this.router.route('/file')
          .post((req, res) =&gt; {
              console.log(req);   //No "body" data             
         });
  }
  </code></pre>
  
  <p>When I get the data, I can see the following:</p>
  
  <pre><code>body:
     imageData: Object {}
     imageID: "Sample"
  </code></pre>
  
  <p>The <code>imageData</code> is empty. Any suggestions to how to send the image?</p>
  
  <p>Thanks.</p>