【发布时间】:2018-09-12 04:25:36
【问题描述】:
如何将我使用 boto3 上传到 AWS S3 的图像上的 ContentType 设置为 content-type:image/jpeg?
目前,我使用 buto3/python 2.7 使用以下命令将图像上传到 S3:
s3.upload_fileobj(bytes_io_file, bucket_name, filename)
但是,要将上传对象的类型设置为 ContentType= 'image/jpeg',我必须通过 Web 界面手动选择 S3 上的所有“文件夹”,并将元数据设置为 Content-type : Image/jpeg
有没有办法在我上面的上传请求中设置这个标志?
提前谢谢你!
【问题讨论】:
标签: python amazon-web-services amazon-s3 boto3