DeepFrontend
Learning Paths
Practice
System Design & DS
Design Studio
Data Structures Curriculum
Real-World Case Studies
Careers
Job Board
Resume Builder
Blog
Sign in
Search
⌘K
Go Pro
Loading compiler resources...
Node.js Quiz Practice
Active Recall Drill Session
← Exit Session
Question 1 of 1
medium
Node.js
A team's Node HTTP server intermittently runs out of memory when handling large file uploads. Code review shows the handler accumulates the entire body into a single string via 'data' events before writing it to disk. What's the fix?
A
Add more server memory as a permanent solution
B
Pipe req directly to a write stream (req.pipe(fs.createWriteStream(...))) instead of buffering the whole body first
C
Switch to a different HTTP method
D
Disable the 'data' event
Check Answer