I have integrated API gateway with S3 to serve audio files. I want to download it using HTTP endpoint exposed from API Gateway and that's where the audio file is getting corrupted (though serves text file properly). Actual file is 2.9 MB and when I send REST request, res returns file(bin file) having size more than 5 MB. Can anyone help me to fix it?
This is answered here. AWS Api Gateway as a HTTP Proxy is currupting binary uploaded image files
However,with slight changes, this is what worked for me:
curl --location --request GET 'https://GATEWAY_URL/pic.jpg' \ --header 'Content-Type: multipart/form-data' \ --header 'Content-Disposition: form-data; name="file"; filename="rahul.jpg"'
In API Gateway settings, add Binary Media Types.
image/jpeg
audio/mpeg
multipart/form-data
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.