Python Boto3复制\u对象大小失败>;5GB
我有以下功能Python Boto3复制\u对象大小失败>;5GB,python,amazon-s3,boto3,Python,Amazon S3,Boto3,我有以下功能 async def _s3_copy_object(self, s3_source, s3_destination): source_bucket, source_key = get_s3_bucket_and_key(s3_source) destination_bucket, destination_key = get_s3_bucket_and_key(s3_destination) print("copying object: {} to {}".
async def _s3_copy_object(self, s3_source, s3_destination):
source_bucket, source_key = get_s3_bucket_and_key(s3_source)
destination_bucket, destination_key = get_s3_bucket_and_key(s3_destination)
print("copying object: {} to {}".format(s3_source, s3_destination))
source = {'Bucket': source_bucket, 'Key': source_key}
await self._async_s3.copy_object(CopySource=source,
Bucket=destination_bucket, Key=destination_key,
ServerSideEncryption='AES256',
MetadataDirective='COPY',
TaggingDirective='COPY')
如果文件小于5gb,这非常有效,但如果对象大于5gb,则会失败
我得到以下错误:
An error occurred (InvalidRequest) when calling the CopyObject operation: The specified copy source is larger than the maximum allowable size for a copy source: 5368709120: 1313
这有什么工作吗?
你应该考虑使用多部分上传。在一个操作中,最大允许的大小是5Gb
您需要使用boto3方法,而不是复制对象
。它将执行复制大于5GB的对象时所需的多部分上载。它还将为您处理线程