Comments (1)
There are a few issues I see with the code you've posted:
-
if (req.complete) { return; }
is not correct, you should always consume
file
whether you're interested in it or not if you have a'file'
event handler. At the minimum that means using something likefile.resume();
before yourreturn
. -
Using the filename as-is like that puts you at risk for security issues if the filename is maliciously crafted (e.g. contains a relative path to escape your upload directory).
-
If the request is still pending after you've verified a response has been sent, then perhaps something (in Express or elsewhere) is still waiting for the request to be completely drained. If that's the case, you'll need to add something like
req.resume()
after youreq.unpipe(busboy)
to ensure any remaining data is drained out.
from busboy.
Related Issues (20)
- 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
- Events order when parsing file HOT 6
- 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
- Error: Malformed urlencoded form HOT 2
- Unknown license vulnerability HOT 2
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.