title: Uploading image using angular 4 and nodejs
body: <p>I am using angular 4 and node using multer to upload image. Everything is running fine there is no error but I dont see the file in the folder. Here is the code.</p>
  
  <pre><code> &lt;td&gt;&lt;input type="file" (change)="fileChange($event)" placeholder="Upload file" accept=".pdf,.jpeg,.png"&gt;&lt;/td&gt; 
  </code></pre>
  
  <p>In component</p>
  
  <pre><code> return this.http.post('http://localhost:3000/api/doc/uploadfile', FormData , {headers:this.headerss}).map((res: Response)=&gt;{
             const data=res.json();
              console.log(data);
              return data;
              }).
              catch(this.handleError);
  </code></pre>
  
  <p>It shows everything being submitted fine
  <a href="https://i.stack.imgur.com/7Tb1D.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7Tb1D.png" alt="enter image description here"></a></p>
  
  <p>Than in nodejs I am using multer </p>
  
  <pre><code>var upload=multer({dest: './uploads/'}).single('avatar');
                 router.post('/uploadfile',  function(req, res){
                     upload(req, res, function(err){
                         if(err){
                             console.log(err);
                             return err;
                         }
                         console.log("request"+ req)
                          return  res.send("completed"+ req) 
                     })
  </code></pre>
  
  <p>There is no error everything goes fine. But I dont see any image being loaded. Please let me know how can I fix this...Thanks </p>