我无法访问我试图通过预签名 URL 访问的文件。
$cmd = $s3Client->getCommand('GetObject', [
'Bucket' => 'test-bucket-pcloud',
'Key' => 'testfile.txt'
]);
$request = $s3Client->createPresignedRequest($cmd, '+20 minutes');
// Get the actual presigned-url
$presignedUrl = (string) $request->getUri();
当在浏览器上访问 URL 时,我得到:
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<Error>
<Code>AuthorizationQueryParametersError</Code>
<Message>X-Amz-Algorithm only supports "AWS4-HMAC-SHA256"</Message>
<RequestId>8D109D39C69E665D</RequestId>
<HostId>
lH+u+MEnbF+Sps0kd/tMEGS0ePHjQlUDGWN8lLnzkXYkrIb0YksK6ahzUflPFMbQG8zUzLFl9y4=
</HostId>
</Error>
可能是什么原因?此外,当我尝试从获取的 URL 访问存储桶时:
$signedURL = $s3Client->getObjectUrl('test-bucket-pcloud','testfile.txt');
我仍然得到同样的错误。
这是存储桶的权限快照: