Skip to content

[Bug] Upload endpoint buffers entire file in memory before writing to disk #23

@unrealandychan

Description

@unrealandychan

In app/api/upload-chart/route.ts, the uploaded file is fully buffered with Buffer.from(await file.arrayBuffer()) before being written. Large files or concurrent uploads can exhaust heap memory.

Fix

Stream the file directly to disk instead of buffering the full ArrayBuffer.

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions