Here I have the image url. filename is the image URL.
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")
It loads things on S3, but shows an error:
/tmp/t.jpeg could not be opened because the associated helper application does not exist. Change the link in your settings.
source share