开发者社区> 问答> 正文

上传OSS报403

The request signature we calculated does not match the signature you provided. Check your key and signing method


Access Key ID          Access Key Secret 确认无误   服务器时间正常
整了几天了 到底要怎么弄 !!!!!!!!!!








<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>562DCDABA1D1B3076C9DFE4E</RequestId>
  <HostId>test-attachment.oss-cn-shenzhen.aliyuncs.com</HostId>
  <OSSAccessKeyId>iC78CGBFyGi0UsoV</OSSAccessKeyId>
  <SignatureProvided>LLNFpiTKLz890KZ2eZhjpgc6k0s=</SignatureProvided>
  <StringToSign>PUT
XrY7u+Ae7tCTyyK7j1rNww==
text/plain
Mon, 26 Oct 2015 06:52:25 GMT
/test-attachment/test-attachment/oss-php-sdk-test/upload-test-object-name.txt</StringToSign>
  <StringToSignBytes>50 55 54 0A 58 72 59 37 75 2B 41 65 37 74 43 54 79 79 4B 37 6A 31 72 4E 77 77 3D 3D 0A 74 65 78 74 2F 70 6C 61 69 6E 0A 4D 6F 6E 2C 20 32 36 20 4F 63 74 20 32 30 31 35 20 30 36 3A 35 32 3A 32 35 20 47 4D 54 0A 2F 74 65 73 74 2D 61 74 74 61 63 68 6D 65 6E 74 2F 74 65 73 74 2D 61 74 74 61 63 68 6D 65 6E 74 2F 6F 73 73 2D 70 68 70 2D 73 64 6B 2D 74 65 73 74 2F 75 70 6C 6F 61 64 2D 74 65 73 74 2D 6F 62 6A 65 63 74 2D 6E 61 6D 65 2E 74 78 74 </StringToSignBytes>
</Error>


    [status] => 403
)

展开
收起
kuaidang 2015-10-26 14:58:33 12300 0
3 条回答
写回答
取消 提交回答
  • endpoint是不是填错了?
    比如应该是oss-cn-shenzhen.aliyuncs.com
    你填成了
    test-attachment.oss-cn-shenzhen.aliyuncs.com?
    2015-10-26 16:22:52
    赞同 展开评论 打赏
  • Re上传OSS报403
    是的 有什么办法吗

    -------------------------

    回3楼xgp的帖子
    $oss = new \ALIOSS(C('OSS_CONFIG.access_key_id'), C('OSS_CONFIG.access_key_secret'), C('OSS_CONFIG.oss_domain'));
    $object = $info['path'];
                $content = file_get_contents($info['path']);

                $options = array(
                'content' => $content,
                'length' => strlen($content),
                );
                $res = $oss->upload_file_by_content($bucket, $object, $options);
                print_r($res);

    -------------------------

    回3楼xgp的帖子
    用下载的默认的SDK  配置了也是报 403
    http://c.*****.com/oss/demo/object_sample.php
    ret:403 创建bucket test-attachment FAIL ret:403 上传字符串到 /test-attachment/oss-php-sdk-test/upload-test-object-name.txt FAIL ret:403 上传字符串到 /test-attachment/oss-php-sdk-test/upload-test-object-name.txt FAIL ret:403 上传字符串到 /test-attachment/oss-php-sdk-test/upload-test-object-name.txt FAIL ret:403 创建模拟文件夹 /test-attachment/test/testa/testb FAIL ret:403 上传本地文件 :/workespace/luojinyi/project/c_scmuyuan_com/oss/demo/object_sample.php 到 /test-attachment/test/testa/testb FAIL ret:403 上传本地文件 :/workespace/luojinyi/project/c_scmuyuan_com/oss/demo/object_sample.php 到 /test-attachment/test/testa/testb FAIL ret:403 上传本地文件 :/workespace/luojinyi/project/c_scmuyuan_com/oss/demo/object_sample.php 到 /test-attachment/test/testa/testb FAIL ret:403 列出Bucket内最多1000个文件 bucket:test-attachment FAIL ret:403 列出Bucket内所有文件test-attachment FAIL ret:403 列出目录下的文件和子目录: test-attachment FAIL ret:403 下载 object /test-attachment/test/testa/testb 到本地文件:test_get_object.txt FAIL ret:403 下载 object /test-attachment/test/testa/testb 到字符串 FAIL ret:403 拷贝object 从 /test-attachment/test/testa/testb 到 /test-attachment/test/testa/testbtest/testa/testb FAIL ret:403 修改Object Meta /test-attachment/test/testa/testb FAIL ret:403 获取object meta FAIL ret:403 删除object FAIL
    2015-10-26 15:45:20
    赞同 展开评论 打赏
  • 阿里云对象存储(OSS)开发工程师
    Re上传OSS报403
    你使用了oss的sdk吗?

    -------------------------

    Re上传OSS报403
    你能把初始化的代码以及你上传文件的那部分代码提供下吗?注意将敏感信息删掉
    2015-10-26 15:35:29
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
对象存储OSS 立即下载
百问百答-OSS (下) 立即下载
百问百答-OSS (上) 立即下载