简体   繁体   English

如何使用 CloudFront 分发将文件上传到后备 S3 存储?

[英]How to use CloudFront distribution to upload files to backing S3 storage?

I have a Cloudfront distribution backed by S3 storage.我有一个由 S3 存储支持的 Cloudfront 发行版。 CloudFront supports POST content-uploads as mentioned here: https://aws.amazon.com/blogs/aws/amazon-cloudfront-content-uploads-post-put-other-methods/ CloudFront 支持 POST 内容上传,如下所述: https://aws.amazon.com/blogs/aws/amazon-cloudfront-content-uploads-post-put-other-methods/

Couple of issues using this -使用这个的几个问题 -

  1. I've enabled the settings as mentioned in the link above, but using Postman, I get 403我已经启用了上面链接中提到的设置,但是使用 Postman,我得到 403
  2. Even if I make it work, what will be the 'secure' way to upload files using CloudFront so that only authenticated users are able to upload to it.即使我让它工作,使用 CloudFront 上传文件的“安全”方式将是什么,以便只有经过身份验证的用户才能上传到它。

Please note that, am trying to create a mobile application, that uses the above config as its backend.请注意,我正在尝试创建一个使用上述配置作为其后端的移动应用程序。 So, users on the mobile app are already authenticated using OAuth with Google/Facebook etc providers.因此,移动应用程序上的用户已经使用 OAuth 与 Google/Facebook 等提供商进行了身份验证。

  1. Check the bucket's policy.检查存储桶的策略。 You must allow PutObject .您必须允许PutObject

  2. That's not really related to CloudFront or S3.这与 CloudFront 或 S3 并没有真正的关系。 Before the action of POST-ing the content, you need to validate that the user is properly authenticated and authorized to do such action.在发布内容之前,您需要验证用户是否经过适当的身份验证并获得执行此类操作的授权。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 拒绝访问云端分发 s3 - Access denied to cloudfront distribution s3 无法在单个 Cloudfront Distribution 上为多个 S3 存储桶提供服务 - Not able to server multiple S3 buckets on a single Cloudfront Distribution 具有 S3 源的 CloudFront 分配响应 XML ListBucketResult - CloudFront Distribution with S3 Origin Responds with XML ListBucketResult 如何使用 AWS S3 存储桶,在没有云端的情况下进行视频流传输 - How to use AWS S3 buckets, for video streaming without cloudfront AWS cloudfront 不更新 S3 中的文件更新 - AWS cloudfront not updating on update of files in S3 何时使用 Amazon Cloudfront 或 S3 - When to use Amazon Cloudfront or S3 如何设置 AWS S3 Glacier 分段上传的存储 class? - How to set the storage class of an AWS S3 Glacier Multipart Upload? 使用 Terraform 使上传到 s3 的本地文件的云端缓存无效 - Invalidate cloudfront cache of local files uploaded to s3 using Terraform Rails Active Storage - 如何将本地文件迁移到 s3 存储桶 - Rails Active Storage - How to migrate local files to s3 bucket 我们可以使用 CarrierWave gem 同时将文件上传到 AWS S3 和谷歌云存储吗? - Can we upload files to AWS S3 and Google Cloud Storage simultaneously using CarrierWave gem?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM