New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when attempting to upload a file that exceeds 'maxBytes' limit #4798
Comments
I'm also experiencing this problem. My sample code is var uploadOptions = {
dirname: 'D:/Khufu_I/Videos',
maxBytes: 20 * 1000 * 1000
}
req.file('video').upload(uploadOptions, function videoUploaded(err, uploadedFiles) {
if (err) return res.serverError(err);
if (!uploadedFiles || !uploadedFiles[0]) {
return res.badRequest('Video was not uploaded.');
}
}); The program crashes without hitting any of the errors. |
As far as I can see, this seems to be a issue with the disk transport, and not with skipper itself. In any case, I can offer a temporary and extremely dirty solution if anyone is interested. There is an interesting bug with skipper when a file which exceeds the if(req._fileparser.form.bytesExpected > 10000000){
req.connection.destroy();
return res.end('File exceeds maxSize. Aborting.'); // This doesn't actually get sent, so you can skip this line.
}
req.file('field').upload({
maxBytes: Number.MAX_VALUE
}, function(err, files){
//file was uploaded?
}); I know, it's horrible, but it actually works quite well for me. As the connection gets destroyed before the upload begins, it's fine for AJAX requests, but not so great for regular form based uploads. |
I'm encoutering the exact same issue, any fixes yet? |
I've created a PR here balderdashy/skipper-disk#6 to fix this issue |
anyone fixed this problem? |
@lyhoanglong please check my last comment for the fix. It works for me but more tests are welcome to make sure the fix is reliable. Thanks! |
@andyhu I'll check this, thanks for reply. |
When I upload a file significantly larger than maxBytes(3x), a response cannot get sent.
in the console I get
A file barely above the limit allows a response to be sent. |
Hi, I still have the error. I have sails js with skipper 0.5.5 and skipper-disk 0.5.4. I try to upload a csv of 45 MB. The error is raised: var outs__ = fsx.createWriteStream(__newFile.fd, encoding);
The detail is: code: "E_EXCEEDS_UPLOAD_LIMIT" An idea on the fix? Thanks, |
Thanks for posting, @koukuko. 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! |
Bump. How to fix this? |
Thanks for posting, @koukuko. I'm a repo bot-- nice to meet you! It has been 30 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! |
I have the same problem as @ameilland how can I make it so that skipper gives me the error so that I can inform the user? |
Still error till now I'm working on sails ver 0.12.14 |
@trungducng just trying to fix this i put in ur upload options maxBytes:10000000000000, and works. i just put 10000000000000 i think if u need < than that should work. let me know if u solved with this |
@cubetechnology @dzcpy got this error while uploading file over stream any solution ?? need a robust solution for dynamic up and down streaming over fs to store file via incoming request. Here is the example of router hook i am trying to upload file
|
Error when attempting to upload a file that exceeds 'maxBytes' limit, is there anything wrong with skipper or is it my problem?
The text was updated successfully, but these errors were encountered: