上传OSS报403
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
赞0
踩0