title: Node.js file upload to Gridfs - Error: Request aborted
body: <p>i have a problem with large file upload to Gridfs via gridfs-stream node module. I have tried to upload smaller files and it's working nicely but when i try to upload larger file (~2gb and more) the node.js server is giving me this error:</p>
  
  <pre><code>Error: Request aborted
  at IncomingMessage.onReqAborted (D:\ProjectName\node_modules\express\node_modules\connect\node_modules\multiparty\index.js:131:17)
  at IncomingMessage.EventEmitter.emit (events.js:92:17)
  at abortIncoming (http.js:1911:11)
  at Socket.serverSocketCloseListener (http.js:1923:5)
  at Socket.EventEmitter.emit (events.js:117:20)
  at TCP.close (net.js:466:12)
  </code></pre>
  
  <p>My code is as follows, also this is all done on local node server:</p>
  
  <pre><code>//crud.js file
  
  var config = require('./config.js')    
  var fs = require('fs')
  var Grid = require('gridfs-stream');
  var gfs = Grid(config.db, config.mongo);
  
  exports.uploadFile = function (req, res) {
  var tempfile = req.files.filename.path;
  var origname = req.files.filename.name;
  var writestream = gfs.createWriteStream({ filename: origname });
  fs.createReadStream(tempfile)
      .on('end', function () {
      res.send('&lt;p&gt;&lt;h1&gt;Upload Complete!&lt;/h1&gt;&lt;p&gt;');
  }).on('error', function () {
          res.send('Error, upload failed!');
      }).pipe(writestream);
  </code></pre>
  
  <p>}</p>
  
  <p>And my main server.js file:</p>
  
  <pre><code>app.configure(function () {
  app.use(express.compress());
  app.use('/', express.static(__dirname + '/upload'));
  app.set('view engine', 'html');
  app.use(express.logger('dev'));
  app.use(express.bodyParser({limit: '1000000mb'}));
  app.use(express.methodOverride());
  app.use(app.router);
  });
  
  app.post('/', crud.uploadFile)
  </code></pre>
  
  <p>And lastly my client:</p>
  
  <pre><code>&lt;div class="col-lg-4"&gt;
      &lt;form id="form" method="post" action="" enctype="multipart/form-data"&gt;
          &lt;input type="file" id="file" name="filename" class="btn btn-warning"&gt;
          &lt;br&gt;
          &lt;input type="submit" value="Upload file" class="btn btn-primary"&gt;
      &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Also i think i should mention that after i get the above error, file starts to upload again but still fails.
  Again, smaller files are no problem. So my question is how am i able to stream large files effectively with this method, or is there a better method for doing this? Thanks.</p>