如何通过api网关将音频文件上传到s3

如何通过api网关将音频文件上传到s3

本文介绍了如何通过api网关将音频文件上传到s3?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在API网关中创建了一个API,用于将音频文件上传到s3,该文件从本地PC作为multipart/form-data发送.

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集成请求如下所示

API integration request is shown below

在"URL路径参数"中,将存储桶添加为参数,并直接添加存储桶名称

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

当我尝试上传文件时,我收到一个错误响应,

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>'

需要进行哪些更改?

推荐答案

经过研究,我发现了一些非常有用的文档

After some research, I found some very useful document

请仔细阅读如果您也面临同样的问题!

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

将multipart/form-data添加到api中的二进制支持.

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

这篇关于如何通过api网关将音频文件上传到s3?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-01 08:50