Comments (6)
I'm not sure what you're saying. file
is just a normal node Readable stream (aside from the custom limit-related event and property), so all of the normal node stream behaviors apply. If you're seeing 'data'
events after 'end'
/'close'
events, then that's a node.js bug.
from busboy.
I mean when reading multiple files. Before first files occur 'end' events, event "data" of secods file occurs. This order is not handled by busboy?
from busboy.
I would say that would be due to node delaying 'end'
/'close'
events until at least the next tick of the event loop and/or #346.
from busboy.
Thanks for fast anwser. I will find some way to solve this issue.
from busboy.
I think this timing issue not happens randomly. It's related files size. (If it's related only even loop, I think it should happens randomly) Only certain size of file group generate this problem. Is there any way to handle this issue in busboy?
from busboy.
I have solved this issue by using pause and resume function in readalbe objects
let index = 0;
const fileList: Readable[] = [];
BusBoy.on("file", (fieldName: string, file: Readable, info: FileInfo) => {
let isFirst = true;
const ownerIndex = index;
index += 1;
file.pause();
fileList.push(file);
const isFirstFile = ownerIndex === 0;
if (isFirstFile) {
const targetFile = fileList.shift();
targetFile!.resume();
}
file.on("data", (chunk: Buffer) => {
// implementation
});
file.on("end", () => {
// implementation
const nextFile = fileList.shift();
if (nextFile) {
nextFile.resume();
return;
}
});
});
from busboy.
Related Issues (20)
- multipart/form-data windows-1251 HOT 4
- Content-Transfer-Encoding for POST request on multipart message not working HOT 2
- ERR_CONNECTION_ABORTED with long file uploads HOT 6
- licenses in package.json is deprecated HOT 2
- Bug on UTF-8 filenames HOT 2
- Problem on utf8 filename HOT 5
- Missing Content-Type HOT 7
- [email protected] SyntaxError: Unexpected token { HOT 1
- Busboy does not recognize `image/jpeg` without `filename` as files HOT 1
- Extracting Filename when Empty String fails
- need to get raw headers HOT 1
- busboy seems to read ahead too fast for many small (< 16KiB) files HOT 5
- Typings for field name HOT 1
- File event has not been triggered with nuxt 3 HOT 5
- Unexpected end of form HOT 2
- File size unavalaible HOT 1
- Unusable uploaded files. HOT 1
- Unusable uploaded files (with the right module) HOT 1
- Error: Unexpected end of form HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from busboy.