francismeynard / lambda-multipart-parser

This nodejs module will parse the multipart-form containing files and fields from the AWS lambda event object. It works very well parsing binary and text files.
MIT License
68 stars 26 forks source link

Uploaded image file getting corrupted after parse. #2

Closed SatejMore closed 3 years ago

SatejMore commented 4 years ago

Hello,

I am uploading jpeg image file, but after performing parse operation using this library the image data is getting converted into buffer having '7 bit' encoding data.

How can I get this buffer data as base64 data after performing parsing operation? If I use the same 7 bit encoded buffer data the image is getting corrupted. I am using node.js as a coding language?

Any suggestion regarding this would be great help.

Thanks & Regards, Satej

pinodex commented 4 years ago

Have you got the Use Lambda Proxy integration enabled in your API Gateway?

francismeynard commented 4 years ago

Hi there, have you enabled the Lambda proxy integration by any change in your api method?

From docs/readme - "Important: Please make sure to enable the "Use Lambda Proxy integration" in API Gateway method Integration request."

francismeynard commented 3 years ago

Closing this issue now. Refer to docs with regards to enabling the "Use Lambda Proxy integration" in API Gateway. Thank

tanoabeleyra commented 3 years ago

I struggled with this too. The problem was that multipart/form-data needs to be configured as "Binary Media Type" in the API Gateway.

image