I am trying to upload a file in boto ,
import io from boto.s3 import connection from boto.s3 import key conn = connection.S3Connection() bucket = conn.get_bucket('my-bucket') my_key = key.Key(bucket, 'asdf') d = b'this is a test....\n' * 512000 f = io.BytesIO(d) my_key.send_file(f, size=4*1024)
However, this leads to:
boto.exception.S3ResponseError: S3ResponseError: 400 Bad Request <?xml version="1.0" encoding="UTF-8"?><Error><Code>BadRequest</Code><Message>An error occurred when parsing the HTTP request.</Message><RequestId>[hex request ID]</RequestId><HostId>[giant piece of base64]</HostId></Error>
Why does this query not work?
(note: the whole reason I use send_file is because open seems to support read only ...)
source share