Skip to content

Support streaming multipart/form-data for large file uploads #158

@oarinv

Description

@oarinv

Description

The current parseMultiFormData method reads the entire request body into memory at once. This approach causes high memory usage or even crashes when uploading large files. It would be helpful to add streaming parsing support so that:

  • Multipart boundaries can be parsed while reading the data
  • Small fields can still be cached in memory
  • File fields are written directly to temporary disk files or output streams
  • Large files can be uploaded without consuming excessive memory

Suggested Improvements

  1. Refactor parseMultiFormData to use a streaming Reader for parsing
  2. For file fields, read and write data incrementally instead of buffering it all in memory

Expected Behavior

Large file uploads should be handled safely, while still supporting small text fields in memory.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions