使用AWS MultipartUpload上传零件时,如果添加md5标头,它将失败。谁能告诉我我是否正确计算了校验和?
现在我只是使用CryptoSwift
并以此方式抓取
data.md5().base64EncodedString()
我上传的数据是
Alamofire.upload(
data,
to: presignedMultipartLink,
method: Alamofire.HTTPMethod.put,
headers: [
"Content-Length": sizeOfPart,
"Content-MD5": data.md5().base64EncodedString()
])
.uploadProgress{...}
.response{...}
如果我取出Content-MD5标头,它就会按需工作。
xml响应是,那么如何添加md5标头?
<Error><Code>AccessDenied</Code><Message>There were headers present in the request which were not signed</Message><HeadersNotSigned>content-md5</HeadersNotSigned><RequestId>requestid</RequestId><HostId>hostid</HostId></Error>
答案 0 :(得分:0)
我需要在getPresignedUrl调用中包含一个参数。否则不能包含在内。 ah ...那些日子之一。