阿里oss multipartUpload 错误

3,659 阅读1分钟

问题描述

分片上传 最后一个请求报错 One or more of the specified parts could not be found or the specified entity tag might not have matched the part's entity tag 错误

// 响应信息
<?xml version="1.0" encoding="UTF-8"?>
<Error>
  <Code>InvalidPart</Code>
  <Message>One or more of the specified parts could not be found or the specified entity tag might not have matched the part's entity tag.</Message>
  <RequestId>5C455831BB4097C0D8F96794</RequestId>
  <HostId>wolaile.oss-cn-hangzhou.aliyuncs.com</HostId>
  <ETag>undefined</ETag>
  <PartNumber>1</PartNumber>
  <UploadId>4B1BF2F5DE064694870DD46E657F0CA6</UploadId>
</Error>

产生原因

经检查发现 ETag 为undefined

解决方法

在阿里云oss控制台 基础设置 > 跨域规则设置 > 编辑规则 “暴露 Headers” 中增加 ETag 即可解决问题