Skip to content

fix: use readable file stream instead of reading file into memory#60

Closed
aavshr wants to merge 1 commit intomainfrom
fix-file-stream
Closed

fix: use readable file stream instead of reading file into memory#60
aavshr wants to merge 1 commit intomainfrom
fix-file-stream

Conversation

@aavshr
Copy link
Copy Markdown
Contributor

@aavshr aavshr commented Mar 8, 2026

Note

Medium Risk
Changes the CLI upload path to use streams and toFile, which affects how file bodies and MIME types are constructed and could surface edge-case regressions in upload behavior (especially for multipart/large files). Scope is limited to the CLI uploader and keeps existing multipart/progress logic largely intact.

Overview
Switches CLI store uploads from readFile+in-memory File construction to streaming file reads via createReadStream and @mixedbread/sdk/uploads toFile, avoiding the Node Buffer 2 GiB limit and reducing memory usage for large files.

Refactors MIME handling from fixMimeTypes(File) to resolveMimeType(filePath) and updates both single-file (uploadFile) and batch uploads to compute sizes from stat().size before creating the stream-backed File used in client.stores.files.upload.

Written by Cursor Bugbot for commit 2f1b084. This will update automatically on new commits. Configure here.

@aavshr
Copy link
Copy Markdown
Contributor Author

aavshr commented Mar 23, 2026

@aavshr aavshr closed this Mar 23, 2026
@aavshr aavshr deleted the fix-file-stream branch March 23, 2026 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants