-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
<Request>.prototype.formData() Image Upload Bug #3969
Comments
More Repro
Curl Request
Note: IMG_7109.jpg is a 2.7 MB JPEG Bun Error
Work AroundBy using
instead of req.formData(), blob contains a 2.7 MB Blob with type Note: FormData.from() is an undocumented method. |
Although not clear why, but it seems that commenting out the following lines makes it work.
Code
It looks like if bun/src/bun.js/webcore/body.zig Lines 251 to 254 in cf86509
An error is thrown here. bun/src/bun.js/webcore/body.zig Lines 702 to 704 in cf86509
|
Yup, that fixed it. Is there any reason that when uploading an image the |
It would appear as .name on the Blob |
What version of Bun is running?
0.7.2
What platform is your computer?
Darwin 22.5.0 arm64 arm (MacOS)
What steps can reproduce the bug?
When running .formData() on
req
, it should create a formData object with the body of request. Instead, the program halts and no further code is ran.Discord Thread: https://discord.com/channels/876711213126520882/876711213126520885/1136905295172489226
Repro
My test uploaded image
What is the expected behavior?
No response
What do you see instead?
No response
Additional information
FormData.from(await req.arrayBuffer(), req.headers.get("content-type").split("boundary=").at(-1))
was a working alternative solution.The text was updated successfully, but these errors were encountered: