Git Product home page Git Product logo

Comments (11)

jiawei666 avatar jiawei666 commented on May 29, 2024

用的是PHP-SDK

from alibabacloud-sdk.

AxiosLeo avatar AxiosLeo commented on May 29, 2024

能否提供下 oss php sdk 的版本,以及使用的 alibabacloud/tea 的版本。

使用 composer show 可以查看依赖组件的版本

from alibabacloud-sdk.

jiawei666 avatar jiawei666 commented on May 29, 2024

alibabacloud/tea v3.1.20
alibabacloud/viapi-utils v0.1.3

from alibabacloud-sdk.

jiawei666 avatar jiawei666 commented on May 29, 2024

调用的方法是AlibabaCloud\SDK\ViapiUtils\ViapiUtils::upload()

from alibabacloud-sdk.

jiawei666 avatar jiawei666 commented on May 29, 2024

所有alibaba的依赖包如下
image

from alibabacloud-sdk.

AxiosLeo avatar AxiosLeo commented on May 29, 2024

我本地没有复现出问题,可以实现通过网络地址上传图片并获取新的 URL 地址,以下是我的复现代码

use AlibabaCloud\SDK\ViapiUtils\ViapiUtils;
use AlibabaCloud\Tea\Exception\TeaUnableRetryError;

try {
  $url = ViapiUtils::upload($access_key_id, $access_key_secret, "https://www.baidu.com/img/PCtm_d9c8750bed0b3c7d089fa7d55720d6cf.png");
  var_dump($url); // result :  "http://viapi-customer-temp.oss-cn-shanghai.aliyuncs.com/LTAI4G4RQZsUUFtibyf6ZSdS/bd39a3fd77d0e9239b78dcfed497a004PCtm_d9c8750bed0b3c7d089fa7d55720d6cf.png"
} catch (TeaUnableRetryError $e) {
  var_dump($e->getMessage());
  var_dump($e->getErrorInfo());
  var_dump($e->getLastException());
  var_dump($e->getLastRequest());
}

如果通过以上代码还是有问题的话,会不会是 AK 上有看不见的特殊字符,或者 AK 不具备访问完整的 Viapi 的权限呢。

可以尝试在 AlibabaCloud\SDK\ViapiUtil\ViapiUtils 类中,断点调试 $viResponse->data->accessKeyId,$viResponse->data->accessKeySecret,$viResponse->data->securityToken,看看这三个取值是否有效。

from alibabacloud-sdk.

jiawei666 avatar jiawei666 commented on May 29, 2024

好,我晚些再试试

from alibabacloud-sdk.

AxiosLeo avatar AxiosLeo commented on May 29, 2024

请问,问题还存在吗?我先 Close 这个 Issue ,如果问题还存在的话,再 reopen

from alibabacloud-sdk.

jiawei666 avatar jiawei666 commented on May 29, 2024

emm 还是不行,方便私聊么 我把ak跟sk发你看下?

from alibabacloud-sdk.

AxiosLeo avatar AxiosLeo commented on May 29, 2024

可以加一下钉钉群:11771185 阿里云官方SDK&CLI客户服务群
在群内反馈下问题,我会及时回复的。

from alibabacloud-sdk.

jiawei666 avatar jiawei666 commented on May 29, 2024

from alibabacloud-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.