AWS S3 SDK `client.put_object` does not overwrite the existing data in the bucket
I am using the below upload function to upload in a bucket but this does not overwrite the existing file in the bucket. If I upload an image with a particular format and update the image. The overwrite function does not work.
def upload(byte_stream, path, filename): bucket = doconn.get_bucket() object_key = os.path.join(path, filename) params = dict( Key=object_key, Body=byte_stream, ACL='public-read' ) bucket.put_object(**params) return object_key