How can I copy files bigger than 5 GB in Amazon S3?

后端 未结 4 1911
执笔经年
执笔经年 2021-02-01 17:59

Amazon S3 REST API documentation says there\'s a size limit of 5gb for upload in a PUT operation. Files bigger than that have to be uploaded using multipart. Fine.

Howev

4条回答
  •  星月不相逢
    2021-02-01 18:48

    The now standard .copy method will perform multipart uploads for files larger than 5gb. Official Docs

    import boto3
    s3 = boto3.resource('s3')
    copy_source = {
        'Bucket': 'mybucket',
        'Key': 'mykey'
    }
    s3.meta.client.copy(copy_source, 'otherbucket', 'otherkey')
    

提交回复
热议问题