问题描述
我正在使用AWS S3预签名url从客户端(移动应用程序)上传图片.我想防止用户上传大文件.有没有办法限制上传文件的文件大小?
I'm using an 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 file size of an uploaded file?
谢谢
推荐答案
在s3策略中检出"content-length-range". 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
content-length-range
上载内容的最小和最大允许大小. 此条件支持content-length-range条件匹配类型.
content-length-range
The minimum and maximum allowable size for the uploaded content. This condition supports content-length-range condition match type.
这篇关于如何使用预签名的URL限制上传到AWS S3服务的文件的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!