-
Notifications
You must be signed in to change notification settings - Fork 24
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
fileSize limit bug #38
Comments
@juliangruber reply please |
@tj reply please |
I'm not maintaining this repo, check out https://github.com/cojs/busboy/commits/master for recent commit authors. I agree that this is a bad bug! If you need a fix more urgent than the maintainers can or want to provide (remember, you're posting this around christmas), you can work on a fix on your own, create a PR and mention me again. It's way easier to merge a PR than fix it. |
I mention recent contributes for help @dead-horse |
There's no need to mention either, if people are watching this repo they will get a notification, if not, they likely aren't interested in maintaining it. Is this issue still relevant to you? If so, please reopen. |
Reopened! |
this module is a wrap of https://github.com/mscdex/busboy, I think you can try to find some solutions or suggestions in there. |
@sm2017 do you listen the file |
@fengmk2 As you are contribute to https://github.com/eggjs/egg-multipart |
@sm2017 can you show me a demo code to reappear this problem on egg-multipart? |
@fengmk2 try this // config/config.default.js
exports.multipart = {
fileSize: 1024,
}; // app/controller/upload.js
const sendToWormhole = require('stream-wormhole');
const Controller = require('egg').Controller;
module.exports = class extends Controller {
async upload() {
const { ctx } = this;
const stream = await ctx.getFileStream();
await sendToWormhole(stream);
ctx.status = 204;
}
}; There is no size limit , but if you set // config/config.default.js
exports.multipart = {
fileSize: 100*1024,
}; we have MultipartFileTooLargeError: Request file too large error |
@fengmk2 Do you test demo code? |
@fengmk2 , @dead-horse please run demo code , we have same issue in egg-multipart too |
Open source is free to use and comes without warranty (see the license). If you need an issue fixed quicker than maintainers can get to it, your best bet is to try to fix it yourself and submit a pull request. |
@sm2017 change const stream = require('stream');
const { promisify } = require('util');
const pipeline = promisify(stream.pipeline);
const { writableNoopStream } = require('noop-stream');
const sendToWormhole = require('stream-wormhole');
let fileStream;
try {
fileStream = await ctx.getFileStream({
limits: {
fileSize: '1mb',
},
});
await pipeline(fileStream, writableNoopStream());
ctx.body = fileStream.filename;
} catch(err) {
console.log('@@', err);
await sendToWormhole(fileStream);
ctx.body = err.message;
} |
@atian25 You set |
@sm2017 yes, see atian25/egg-showcase#18 the router and test case |
Hi, what's the status here? For me, it looks like busboy is not able to handle file size limitation correctly. @sm2017 test suite confirms my issues with it. |
@StarpTech I opened issue about 2 years ago! I really don't remember what happened |
Thanks for responding. |
I found that fileSize works well if we set it large enough , but when we have a small fileSize limit , it not works , for instance if you set fileSize=1024 or fileSize=1 , there is no limit , you can upload file with no size limit , I test it and I see that I can upload 5MB files
I guess , When we set fileSie limit less than highWaterMark it occures
The text was updated successfully, but these errors were encountered: