Comments (6)
Have tried to debug a little more, and found out that the issue is happening before I do any uploading to S3. When logging ReadStream
s from files
array, I get some with an empty buffer
(see first ReadStream
in the example below):
[ReadStream {
_readableState:
ReadableState {
objectMode: false,
highWaterMark: 65536,
buffer: [],
length: 0,
pipes: null,
pipesCount: 0,
flowing: null,
ended: false,
endEmitted: false,
reading: false,
sync: true,
needReadable: false,
emittedReadable: false,
readableListening: false,
resumeScheduled: false,
defaultEncoding: 'utf8',
ranOut: false,
awaitDrain: 0,
readingMore: false,
decoder: null,
encoding: null },
readable: true,
domain: null,
_events:
{ end: [Function],
open: { [Function: g] listener: [Function: close] } },
_eventsCount: 2,
_maxListeners: undefined,
path: '/var/folders/fh/w1h08fy12fngm0x499_3xr300000gn/T/1461446649726files174659 copy.jpg',
fd: null,
flags: 'r',
mode: 438,
start: undefined,
end: undefined,
autoClose: true,
pos: undefined,
fieldname: 'files',
filename: '174659 copy.jpg',
encoding: '7bit',
transferEncoding: '7bit',
mime: 'image/jpeg',
mimeType: 'image/jpeg',
destroyed: true
}, ReadStream {
_readableState:
ReadableState {
objectMode: false,
highWaterMark: 65536,
buffer: [ <Buffer ff d8 ff e1 23 a8 45 78 69 66 00 00 49 49 2a 00 08 00 ... > ],
length: 58676,
pipes: null,
pipesCount: 0,
flowing: null,
ended: true,
endEmitted: false,
reading: false,
sync: false,
needReadable: false,
emittedReadable: true,
readableListening: false,
resumeScheduled: false,
defaultEncoding: 'utf8',
ranOut: false,
awaitDrain: 0,
readingMore: false,
decoder: null,
encoding: null },
readable: true,
domain: null,
_events: { end: [Function] },
_eventsCount: 1,
_maxListeners: undefined,
path: '/var/folders/fh/w1h08fy12fngm0x499_3xr300000gn/T/1461446650318filesJANA8828-logo.jpg',
fd: 35,
flags: 'r',
mode: 438,
start: undefined,
end: undefined,
autoClose: true,
pos: undefined,
fieldname: 'files',
filename: 'JANA8828-logo.jpg',
encoding: '7bit',
transferEncoding: '7bit',
mime: 'image/jpeg',
mimeType: 'image/jpeg'
}]
Also interesting to notice, that first ReadStream
from the example above has destroyed: true
property, but the second one lacks it. Directly opposite to buffer
property values.
Probably, means the problem is inside async-busboy
or inside busboy
itself.
from async-busboy.
@manakor Thanks for reporting!
We have been using the library quite extensively (on stage) on Mac OSX and Ubuntu 15 without bumping into this issue so far. What OS/NodeJS version are you running ?
from async-busboy.
Mac OSX 10, Nodejs 5.
from async-busboy.
I've made a small fix in 0.0.6 that hopefully should solve your problem.
Basically the code now waits that the writeStream
is opened before creating the readStream
.
This should ensure that the file array always contains valid read stream.
Check it out and let me know if that doesn't solve your issue.
Thanks again for reporting!
from async-busboy.
@m4nuC do you think this issue is related? It seems similar.
from async-busboy.
@ivancortesromero sorry for the delay. Will check over the weekend
from async-busboy.
Related Issues (20)
- Is there a way to expose uploading progress? HOT 3
- How to "drain the request stream" HOT 1
- Throw on('limit') ? HOT 4
- Documentation needs an update HOT 1
- TypeError: request.on is not a function HOT 3
- filePromises not passing to custom onFile HOT 3
- Can't read the file content HOT 1
- how to writestream to desired path in local ? HOT 2
- using asyncBusboy in two middleware HOT 1
- Cleanup function will not remove custom onFile function, memory leak HOT 4
- formData.files as on object
- How can you do onFile with async? HOT 3
- node 14 HOT 18
- Processing unindexed array fields cause a whole process to crash
- Breaks on Node 16 HOT 8
- Replace unsupported busboy version with fastify fork
- Update to busboy 1.3 HOT 1
- Sometime asyncBusboy never responding HOT 2
- 504 Gateway timeout for specific files (.csv / .xlsx) HOT 3
- Publish a new version to npm HOT 5
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 async-busboy.