Open ghost opened 3 years ago
To anyone else who sees this, you probably didn't pass on the content type and accept properties inside the API gateway. The response you should be getting should be base64.
same problem here
@cabraljv I solved this by following the instructions here: https://stackoverflow.com/a/62819124/1786840
... Don't forget to hit "Deploy API".
It's not working, I see no proper solution can anyone suggest how to solve it?
Still does not work.
If the file is 30Kb when I pass it to S3 and save it its only 27.8Kb
I get this when I print the file object but I use the same content for S3 body the file is corrupted.
{
content: <Buffer fd fd fd fd 00 10 4a 46 49 46 00 01 01 00 00 48 00 48 00 00 fd fd 00 40 45 78 69 66 00 00 4d 4d 00 2a 00 00 00 08 00 01 fd 69 00 04 00 00 00 01 00 00 ... 445388 more bytes>,
filename: 'MyImage.jpg',
contentType: 'image/jpeg',
encoding: '7bit',
fieldname: 'image'
}
Hi @michari Did you resolve the issue? Now I am facing the same issue.Could you please help me if you found any solution?
For me anyways, the issue was for sure the binary media supported in API Gateway. You can do this by hand by going to API Gateway -> {Your API} -> Settings -> Edit -> Binary Media Types
Make sure to use multipart/form-data
and not /multipart/form-data
as the placeholder text might misleadingly suggest. You can also do this automatically via SAM in your template as shown below
sam-template.yaml
Globals:
Api:
BinaryMediaTypes:
- multipart/form-data
@ghost @michari @vibinreji
Hello,
I am having an issue where my files are being corrupted. I have checked the previous issues and made sure "Binary Media Types" are correct:
I have also made sure Lambda proxy is setup:
Any ideas as to what my issue is?