Use formidable upload files, always get "Error Request Aborted"
- I use Express(3.6.0) + formidable(latest) for upload files to S3.
- When I submit post , then I always got
Error Request Aborted. - incoming_form.js:
IncomingForm.prototype.parse = function(req, cb) {
.......
.......
.......
req
.on('aborted', function() {
self.emit('aborted');
self._error(new Error('Request aborted'));
})
.......
.......
.......
}
[Error: Request aborted]
child process: Request aborted
Error: Request aborted
at IncomingMessage.<anonymous>
(/node_modules/formidable/lib/incoming_form.js:107:19)
at IncomingMessage.EventEmitter.emit (events.js:117:20)
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:465:12)
I want to know why I got aborted and how to debug it.
same here for big file uploads (1mb - 15mb)
+1
yep this is crashing my site (image uploads) every once in a while... not good.
Has anyone found a solution? I am having same issue. Other uploads are working fine, but image upload is failing. This started after I upgraded node to the latest 0.10.29
It is the client that is aborting, not the server. It's an error you can always get and which you must handle. It's not a bug in formidable.
+1
Same here.. happening with files lesser than 100 kb.. Anyone handled this case?
I see this for files as small as 10kb. My client aborts the request after 2 mins latency. So there is something here at play. Removing the express bodyparser didn't helped either
Same here....but I find the reason is that I use ths multer module for parsing multipart/form-data. So that is resulting in the formidable can't parse correctly.
to disable body-parser for multipart/form-data in your router
exmple solution of nodejs
app.use(express.json()).use(express.urlencoded())
+1 Removing the express bodyparser didn't helped either
Very weird this issue!!
I believe it is Express or browser problem, because I did many test with Firefox, Chrome and Chrome Canary. Only the Chrome Canary stopped! By the way... I used many ways to do upload, including my own upload lib... always stop!!
+1 how to solve it
how to sovle it.
try to delete this in your app.js.
app.use(express.bodyParser());
I have sovled this proplem.
Getting rid of the app.use(bodyParser.json()); helped.
I'm trying to use formidable in a firebase function, and am getting this error for every request.
Same problem here, but it is very strange that my app is running perfectly on local machine, but when i upload that on c9 and my digital ocean droplet it started to giving this error. i remove body parser as well and try this from firefox also, but no luck. Have you guys got any other solution ?
What if I need bodyparser and formidable and i can't remove bodyparser from my app? What I should do?
I have many more post request routes for which I am using body parser and in few of them I need formidable. What should I do?