title: Uploading files Node.js Express put method
body: <p>I am trying to do a file upload using XMLHttpRequest, I am splitting file and chunk_size is 10KB.
  On server I am using </p>
  
  <pre><code>app.route('/upload/').put(function(req, res, next) {
  
      var  buff =req._readableState.buffer[0];
      console.log('Buffer length: ' + buff.length);   
  }
  </code></pre>
  
  <p><strong>console.log: "Buffer length: 10240"</strong></p>
  
  <p>And I am writing file:</p>
  
  <pre><code>fs.write(fd,buff,0,buff.length,pos,function(){}
  </code></pre>
  
  <p>I am not using busboy, multer or body-parser
  and everything works like a charm.</p>
  
  <p>Then I changed chunk_size to 100KB and client is sending 100KB, I checked Content-Length.</p>
  
  <p>But server is receiving 31972 Bytes and sometimes 64061 Bytes.</p>
  
  <p><strong>console.log: "Buffer length: 31972"</strong></p>
  
  <p>No idea what is happening, any help would be appreciated.</p>