[英]Boto3 Copy_Object failing on size > 5GB
I have the following function我有以下功能
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')
This works great if the file is under 5gb, but fails if the object is over 5gb.如果文件小于 5gb,这很有效,但如果对象超过 5gb,则失败。
I get the following error:我收到以下错误:
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
调用 CopyObject 操作时发生错误(InvalidRequest):指定的复制源大于复制源的最大允许大小:5368709120:1313
Is there a work around for this?有解决办法吗?
You should consider using Multipart uploads.In a single operation, maximum allowed size is 5GB您应该考虑使用分段上传。在单个操作中,最大允许大小为 5GB
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.