【发布时间】:2014-10-12 09:32:35
【问题描述】:
我已经连接到实例,我想将我的 python 脚本生成的文件直接上传到 S3。我试过这个:
import boto
s3 = boto.connect_s3()
bucket = s3.get_bucket('alexandrabucket')
from boto.s3.key import Key
key = bucket.new_key('s0').set_contents_from_string('some content')
但这只是在我想将目录 s0 上传到 mybucket 时创建一个具有上下文“相同内容”的新文件 s0。
我也看过 s3put,但没有得到我想要的。
【问题讨论】:
-
你可能想看看这个,看起来像somewhat similar question
标签: python-2.7 amazon-web-services amazon-ec2 amazon-s3 boto