python - Why do I get a 400 when uploading a file with boto? -
i'm attempting upload file boto
,
import io boto.s3 import connection boto.s3 import key conn = connection.s3connection() bucket = conn.get_bucket('my-bucket') my_key = key.key(bucket, 'asdf') d = b'this test....\n' * 512000 f = io.bytesio(d) my_key.send_file(f, size=4*1024)
however, results in:
boto.exception.s3responseerror: s3responseerror: 400 bad request <?xml version="1.0" encoding="utf-8"?><error><code>badrequest</code><message>an error occurred when parsing http request.</message><requestid>[hex request id]</requestid><hostid>[giant piece of base64]</hostid></error>
why request failing?
(note: whole reason i'm using send_file
here because open
apparently supports reading…)
for it's worth, replacing send_file()
set_contents_from_file()
worked me (i had same error).
python amazon-web-services amazon-s3 boto
No comments:
Post a Comment