views:

82

answers:

1

I have a connection that works as I can list buckets, but having issues when trying to add a object.

conn = S3Connection(awskey, awssecret)

key = Key(mybucket)

key.key = p.sku
key.set_contents_from_filename(fullpathtofile)

I get the error:

'attribute error: 'str' object has no attribute 'connection'

the error is in the file:

/usr/local/lib/python2.6/dist-package/boto-2.obl-py2.6.egg/boto/s3/key.py' line # 539
+1  A: 

Key expects a bucket object as its first parameter (possibly created by conn.create_bucket()).

It looks like mybucket isn't a bucket, but a string, so the call fails.

sth
thanks, that was it. btw k.set_acl('public-read') doesn't work, am I missing something?
Blankman
@blank: No idea about `set_acl`
sth