这里我有一个图片网址。文件名是图像的URL使用boto在s3上传图片
def upload(filename, content)
conn = S3Connection(aws_access_key, aws_secret_key)
b = Bucket(conn, bucket_name)
k = Key(b)
k.key = filename..split('/')[::-1][0]
k.set_metadata("Content-Type", 'images/jpeg')
k.set_contents_from_string(content)
k.set_acl("public-read")
上传东西到S3,但它显示了错误:
/tmp/t.jpeg
could not be opened, because the associated helper application does not exist. Change the association in your preferences.
哪一行是抛出错误?在我看来,你的问题可能不在你粘贴的那段代码中。 – 2010-11-18 12:31:31
这似乎是尝试在Firefox/Windows中打开JPEG图像时得到的错误消息。您可以随时使用Windows照片查看器打开JPEG图像。检查您打开* .jpg和* .jpeg文件的应用程序在Firefox或Windows中是否正确关联。 – scoffey 2010-11-18 15:54:20