【发布时间】:2016-07-14 09:57:03
【问题描述】:
我正在尝试从我的 S3 存储桶中获取图像并将其返回以在我的 API 网关中使用。 权限设置正确。
import boto3
s3 = boto3.resource('s3')
def handler(event, context):
image = s3.meta.client.download_file('mybucket', 'email-sig/1.png', '/tmp/1.png')
return image
但是我得到一个空返回,似乎无法弄清楚如何获取图像。这是正确的方法吗?为什么它不返回我的图像。
【问题讨论】:
标签: amazon-web-services amazon-s3 aws-lambda boto3 aws-api-gateway