[英]How to upload large file using AWS Gateway and S3 proxy
I have AWS Gateway API configured as proxy for S3 to upload a file to S3 bucket.我将 AWS 网关 API 配置为 S3 的代理,以将文件上传到 S3 存储桶。 I have configured binary media to support
multipart/form-data
我已经配置了二进制媒体来支持
multipart/form-data
I am able to upload a file of size 10MB or less without any issue.我可以毫无问题地上传大小为 10MB 或更小的文件。 However when the file size is more than 10MB i get
413 Request Entity Too Large
issue.但是,当文件大小超过 10MB 时,我会收到
413 Request Entity Too Large
问题。
I know that AAG has hard limit of 10 MB on payload.我知道 AAG 对有效载荷有 10 MB 的硬限制。
Questions问题
1>Isn't adding multipart/form-data
should solve the 10 MB limit issue? 1> 添加
multipart/form-data
不应该解决 10 MB 限制问题吗? Do i need to configure anything else?我还需要配置什么吗?
2>Another approach recommended is to create pre-signed url . 2>推荐的另一种方法是创建预签名 url 。 I am assuming for this approach to work client has to make call to get pre-signed url and then use that url to upload a file.
我假设这种工作方法的客户必须拨打电话以获得预签名 url,然后使用该 url 上传文件。 Is this the only approach to upload a large file?
这是上传大文件的唯一方法吗?
Note that I have gone through several SO post regarding the same issue, but most of them are old and i am curious to see if there are any new recommendations.请注意,我已经浏览了几个关于同一问题的 SO 帖子,但其中大部分都是旧的,我很想知道是否有任何新的建议。
The 10 MB payload limit is hard and cannot be increased [ 1 ]. 10 MB 的负载限制是硬性的,不能增加 [ 1 ]。
It seems to be possible to split the file into chunks on the client and then put it together on the server again [ 2 ] to circumvent the 10 MB limit, but I do not think this is a reasonable approach.似乎可以在客户端将文件拆分成块,然后再次将它们放在服务器上 [ 2 ] 以规避 10 MB 的限制,但我认为这不是一个合理的方法。 The pre-signed URL approach seems better to me, if you do not use a client SDK which provides functionality for chunking.
如果您不使用提供分块功能的客户端 SDK,预签名 URL 方法对我来说似乎更好。
Please note that if you ever decide to move away from S3, you can still implement the very same interface on any server yourself.请注意,如果您决定离开 S3,您仍然可以自己在任何服务器上实现完全相同的接口。 In my opinion it is therefore the way to go.
因此,我认为这是通往 go 的路。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.