I have the same issue as in #23 .
my code: https://gist.github.com/moglash/30723a81d10c873f21cb
error:
Error: EMAXBUFFER: An Upstream (`NOOP_file`) timed out before it was plugged into a receiver. It was still unused after waiting 4500ms. You can configure this timeout by changing the `maxTimeToBuffer` option.
at null.<anonymous> (.../node_modules/sails/node_modules/skipper/standalone/Upstream/Upstream.js:86:15)
at Timer.listOnTimeout [as ontimeout] (timers.js:112:15)
22 Feb 15:14:24 - [nodemon] app crashed - waiting for file changes before starting...
I am also facing this error, can you suggest a way to avoid a server crash is form type is not multipart.
I have the same problem.
I check if an optional file was uploaded, if not I get an error even if I manage the upload (using upload callback).
Of course I have the last version of sails and skipper.
This is a very serious problem!!!
FYI @handonam and I just spent an hour tracking this down at a hack night... @antocorso check to make sure you're only calling req.file('blah') once, and calling upload on the object returned. It turns out that at least in the empty case, every time you call req.file('blah') it returns a new object that needs to have upload set on it, so if you do something like
if(req.file('blah')._files.length) {
// do something
} else {
// clear the buffer
req.file('blah').upload(function() {});
}
This results in creating the object twice, and only the second would have the upload set. Instead do something like
var reqFile = req.file('blah');
if(reqFile._files.length) {
// do something
} else {
// clear the buffer
reqFile.upload(function() {});
}
:+1: thanks @kball ! Just to note, the callback in .upload() was important for it to work.
Thanks for posting, @barczaG. I'm a repo bot-- nice to meet you!
It has been 60 days since there have been any updates or new comments on this page. If this issue has been resolved, feel free to disregard the rest of this message. On the other hand, if you are still waiting on a patch, please:
Thanks so much for your help!
Thanks it still working on Sails v0.12.3
Thanks @kball is working like a charm.
It doesn't work in Sails v1
Most helpful comment
FYI @handonam and I just spent an hour tracking this down at a hack night... @antocorso check to make sure you're only calling req.file('blah') once, and calling upload on the object returned. It turns out that at least in the empty case, every time you call req.file('blah') it returns a new object that needs to have upload set on it, so if you do something like
This results in creating the object twice, and only the second would have the upload set. Instead do something like