-
-
Notifications
You must be signed in to change notification settings - Fork 375
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
Error using http-multipart-body-parser to upload images #1106
Comments
Thanks for reporting! Do you think you could write a failing unit test? Take an attempt at a PR to resolve? |
I did a little digging, might be related to the |
Closing due to lack of feedback. Please reopen if adding |
I experience the same issue. I send a PNG file (26,403 bytes) via Postman (multpart/form-data, If I use the following middy packages: (I also tried with older v4 packages) Both plugins called before
Console result:
If I use a similar multipart/form-data processor package
Result:
Both packages use |
Looking at the two implementations:
This means it can only handle files up to a certain size.
To support larger files, Note: @paulmaszlik can you create a PR with a unit test? |
just pass charset: 'binary' to the middleware like this: httpMultipartBodyParser({
charset: "binary",
}) |
@ajaz-ur-rehman Thanks, I'll add this to the docs. |
Describe the bug
When I pass my request through the middleware and try to write the buffer as a file in my server-side code, its file size is considerably higher than the original one, and the file itself is corrupted. Plain text files are processed and stored without any problem.
To Reproduce
How to reproduce the behaviour:
Code to write the file:
Expected behaviour
The file content I receive on my server is the same as I send in my request. The file resulting from writing the content buffer is not corrupt.
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: