通过CloudFront将内容上传到S3

通过CloudFront将内容上传到S3

本文介绍了通过CloudFront将内容上传到S3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个需要将图像上传到S3的应用程序。现在我是这样的:

I'm working on an app which requires to upload images to S3. Now I am doing like this:

S3PutObjectRequest *por = [[S3PutObjectRequest alloc] initWithKey:nameOfThePicture inBucket:nameOfTheBucket];
    por.contentType = @"image/jpg";
    por.data        = imageData;

    // Put the image data into the specified s3 bucket and object.
    S3PutObjectResponse *putObjectResponse = [self.s3 putObject:por];
    por.delegate = self;

直接将图像上传到S3太慢了,我已经配置了CloudFront服务。 现在,我想通过CloudFront将图像上传到S3中的原始存储桶。有可能做到吗?如果是,我该怎么办?

Uploading an image directly to S3 is too slow and I have configured the CloudFront service. Now, I'd like to upload an image through CloudFront to the origin bucket in S3. Is possible to do it? If yes, how could I do it?

非常感谢,

Victor

推荐答案

否。 CloudFront是单向事务—您可以通过CloudFront从S3检索对象,但是不能通过CloudFront将对象上传到S3。

No. CloudFront is a one-way affair — you can retrieve objects from S3 through CloudFront, but you cannot upload objects to S3 through CloudFront.

这篇关于通过CloudFront将内容上传到S3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 03:15