title: NodeJs : Get image stream
body: <p>I am trying to read image stream in my web api.</p>
  
  <p>Following is my code.</p>
  
  <pre><code>var express = require('express');
  var bodyParser = require('body-parser');
  var app = express();
  var Busboy = require('busboy');
  
  app.use(bodyParser.json());
  
  app.get('/', function(req, res) {
      res.send('Hello World!');
  });
  
  app.post('/', function(req, res){
  var busboy = new Busboy({
          headers: request.headers
      });
      busboy.on('file', function(fieldname, file, filename, encoding, mimetype) {
          console.log('File [' + fieldname + ']: filename: ' + filename + ', encoding: ' + encoding + ', mimetype: ' + mimetype);
          file.on('data', function(data) {
              console.log('File [' + fieldname + '] got ' + data.length + ' bytes');
          });
          file.on('end', function() {
              console.log('File [' + fieldname + '] Finished');
          });
      });
  });
  
  app.listen(3000, function() {
      console.log('Example app listening on port 3000!');
  });
  </code></pre>
  
  <p>When I test the above post endpoint using postman, Nothing happens.
  It seems that the busboy.on is never called/triggered.</p>
  
  <p>Busboy npm <a href="https://www.npmjs.com/package/busboy#readme" rel="nofollow noreferrer">https://www.npmjs.com/package/busboy#readme</a></p>
  
  <p>Following is my request. Traced through fiddler.</p>
  
  <pre><code>POST http://localhost:3000/ HTTP/1.1
  Host: localhost:3000
  Connection: keep-alive
  Content-Length: 879585
  Postman-Token: 1defded8-01ff-eb6e-4afa-c49f63b477db
  Cache-Control: no-cache
  Origin: chrome-extension://fhbjgbiflinjbdggehcddcbncdddomop
  User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36
  Content-Type: multipart/form-data; boundary=----WebKitFormBoundarySrX3beIdojsVD2nB
  Accept: */*
  Accept-Encoding: gzip, deflate, br
  Accept-Language: en-US,en;q=0.8,fr-CA;q=0.6,fr;q=0.4
  
  ------WebKitFormBoundarySrX3beIdojsVD2nB
  Content-Disposition: form-data; name="File"; filename="Chrysanthemum.jpg"
  Content-Type: image/jpeg
  </code></pre>