CloudfFont GetObjectRequest 相当于从S3下载文件

CloudfFont GetObjectRequest equivalent to download files from S3

我正在修改应用程序以使用私有 CloudFront 而不是直接来自 S3。

我已经能够创建签名 URL 并根据需要填充图片框。

我找不到与 GetObjectRequest 等效的 CloudFront...

for (int num = 1; num < 16; num++)
{

    GetObjectRequest request = new GetObjectRequest
    {
        BucketName = ContainerName,
        Key = tempDownload + @"/" + num + ".jpg"
    };

    try
    {
        //Issue request and remember to dispose of the response
        using (GetObjectResponse response = s3Client.GetObject(request))
        {
          string dest = Path.Combine(newFileFolder, tempDownload + num + ".jpg");
            if (!File.Exists(dest))
            {
                response.WriteResponseStreamToFile(dest);
            }
        }
    }
}

我正在尝试通过 Cloudfront 下载文件到应用程序用户的硬盘上。

CloudFront 没有 GetObject 的等效项。 CloudFront 旨在通过 HTTP/HTTPS 协议提取数据。

如果您要下载到用户计算机的文件是 public,那么您只需通过 CloudFront 分发 http/https URL.

即可访问它们

如果您要下载的文件是私有的,那么您需要通过您的 CloudFront 分配 http/https URL.[= 将源访问身份设置为 Serve Private Content or use Pre-signed URLs 12=]