How to upload audio file to s3 via api gateway?

2019-08-19 00:51发布

I created an API in API Gateway to upload audio files to s3, the file is sending from local PC as multipart/form-data.

API integration request is shown below

api integration request is shown below

In URL Path Parameters, added bucket as param and directly added the bucket name

enter image description here

When I try to upload the file I get an error response,

body: '<?xml version="1.0" encoding="UTF-8"?>\n<Error><Code>InvalidArgument</Code><Message>x-amz-content-sha256 must be UNSIGNED-PAYLOAD, STREAMING-AWS4-HMAC-SHA256-PAYLOAD, or a valid sha256 value.</Message><ArgumentName>x-amz-content-sha256</ArgumentName><ArgumentValue>null</ArgumentValue><RequestId>123445667788</RequestId><HostId>abcd/Jefgh2272vb/ghvsvds+gh+6273gdhsg+gdgshdshdsjdsj=</HostId></Error>'

What are the changes need to be done?

1条回答
Juvenile、少年°
2楼-- · 2019-08-19 01:35

After some research, I found some very useful document

please go through this if you also face the same probem!!

added multipart/form-data to binary support in api.

查看更多
登录 后发表回答