AWS S3 pre-标识的URL内容长度 [英] AWS S3 Pre-signed URL content-length

查看:461
本文介绍了AWS S3 pre-标识的URL内容长度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用AWS的S3 presigned网址上传从客户端(手机应用程序)的画面。 我想prevent用户上传大文件。 有没有办法来限制上传文件的内容长度?

I'm using AWS S3 presigned url to upload picture from a client (mobile app). I want to prevent the user to upload large files. Is there a way to limit the content-length of the uploaded file?

感谢

推荐答案

查阅内容长度范围的S3政策。  的http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-HTTPPOSTConstructPolicy.html

Check out "content-length-range" in s3 policy. http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-HTTPPOSTConstructPolicy.html

在一个POST政策的条件是对象,其每一个被用来验证载对象的内容的阵列。您可以使用这些条件来限制哪些是允许的请求。您在表格中注明(X-AMZ-签名,文件,政策,和字段名称有一个X ignore- preFIX除外),每个表单字段必须出现在条件列表中。

The conditions in a POST policy is an array of objects, each of which is used to validate the contents of the uploaded object. You can use these conditions to restrict what is allowed in the request. Each form field that you specify in a form (except x-amz-signature, file, policy, and field names that have an x-ignore- prefix) must appear in the list of conditions.

内容长度范围
  用于上载的内容的最小和最大允许大小。   这种情况支持内容长度范围的情况匹配类型。

content-length-range
The minimum and maximum allowable size for the uploaded content. This condition supports content-length-range condition match type.

这篇关于AWS S3 pre-标识的URL内容长度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆