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)
I am getting this error when uploading multiple file in node js using connect multiparty middleware. I am not even uploading big size files. its not more than 50mb. Specifically getting this error when internet connection is disconnected while uploading files. Is there a any way to handle this error.
In my case, I can resolve adding more request / response timeout.
If you're using express:
var server = app.listen(app.get('port'), function() {
debug('Express server listening on port ' + server.address().port);
});
server.timeout = 1000 * 60 * 10; // 10 min
There is also a middleware for Connect / Express: https://github.com/expressjs/timeout
If you're not using express and are only working with vanilla node:
var http = require('http');
var server = http.createServer(function (req, res) {
setTimeout(function() {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}, 200);
}).listen(3000, '127.0.0.1');
server.timeout = 1000 * 60 * 10; // 10 min
console.log('Server running at http://127.0.0.1:3000/');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With