Limit Size Of Objects While Uploading To Amazon S3 Using Pre-Signed URL

前端 未结 2 601
野趣味
野趣味 2020-12-14 15:57

I know of limiting the upload size of an object using this method: http://doc.s3.amazonaws.com/proposals/post.html#Limiting_Uploaded_Content

But i would like to know

2条回答
  •  佛祖请我去吃肉
    2020-12-14 16:24

    The V4 signing protocol offers the option to include arbitrary headers in the signature. See: http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html So, if you know the exact Content-Length in advance, you can include that in the signed URL. Based on some experiments with CURL, S3 will truncate the file if you send more than specified in the Content-Length header. Here is an example V4 signature with multiple headers in the signature http://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html

提交回复
热议问题