Move files between two AWS S3 buckets using boto3

后端 未结 7 1795
难免孤独
难免孤独 2020-12-01 07:52

I have to move files between one bucket to another with Python Boto API. (I need it to \"Cut\" the file from the first Bucket and \"Paste\" it in the second one). What is th

7条回答
  •  清歌不尽
    2020-12-01 08:17

    Bucket name must be string not bucket object. Below change worked for me

    for k in src.list():
        dst.copy_key(k.key, src.name, k.key)
    

提交回复
热议问题