FileCodeBox
FileCodeBox copied to clipboard
阿里云OSS下载报错:SignatureDoesNotMatch
配置正确后能正常上传文件,但下载时报错SignatureDoesNotMatch:
<Error>
<Code>SignatureDoesNotMatch</Code>
<Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message>
<RequestId>65DA19AE09E59839308E9C36</RequestId>
<HostId>testexample.oss-cn-hangzhou.aliyuncs.com</HostId>
<AWSAccessKeyId>LTAI5tRU7E3nDdJtkibD62m7</AWSAccessKeyId>
<SignatureProvided>IRmZh4spCWLR926M9ukbnSmFzJ0=</SignatureProvided>
<StringToSign>GET 1708795817 /testexample/testexample/share/data/2024/02/25/7316ceba652e43159ecfa9f69d634672.webp</StringToSign>
<StringToSignBytes>47 45 54 0A 0A 0A 31 37 30 38 37 39 35 38 31 37 0A 2F 66 69 6C 65 62 6F 78 2D 77 6F 6F 6C 69 6F 2F 66 69 6C 65 62 6F 78 2D 77 6F 6F 6C 69 6F 2F 73 68 61 72 65 2F 64 61 74 61 2F 32 30 32 34 2F 30 32 2F 32 35 2F 37 33 31 36 63 65 62 61 36 35 32 65 34 33 31 35 39 65 63 66 61 39 66 36 39 64 36 33 34 36 37 32 2E 77 65 62 70 </StringToSignBytes>
<EC>0002-00000307</EC>
<RecommendDoc>https://api.aliyun.com/troubleshoot?q=0002-00000307</RecommendDoc>
</Error>
这个问题主要是AWSAccessKeyId值不对,需要改成 OSSAccessKey
@veoco 可以兼容一下
@gooduw 简单的处理办法是把oss的bucket设置为公共读
大佬,求你阿里云OSS配置的示例截图,我学习参考下,谢谢
大佬,求你阿里云OSS配置的示例截图,我学习参考下,谢谢
抱歉,早就没用了