TP3.2怎么引入百度云的SDK上图这是官方给的目录,以下我本地原生PHP已经测试好了,一切正常,请问怎么集成到TP上呢,本地代码如下:
<?php
include 'BaiduBce.phar'; use BaiduBce\BceClientConfigOptions;
use BaiduBce\Util\Time;
use BaiduBce\Util\MimeTypes;
use BaiduBce\Http\HttpHeaders;
use BaiduBce\Services\Bos\BosClient;
$BOS_TEST_CONFIG =
array(
'credentials' => array(
'accessKeyId' => '111111111',
'secretAccessKey' => '222222222',
),
);
//新建BosClient
$client = new BosClient($BOS_TEST_CONFIG);
$bucketName = 'test';
$objectKey = '2/222.png';//上传后的文件名
$fileName = '1.png';//本地文件名$res = $client->putObjectFromFile($bucketName, $objectKey, $fileName);var_dump($res);
<?php
include 'BaiduBce.phar'; use BaiduBce\BceClientConfigOptions;
use BaiduBce\Util\Time;
use BaiduBce\Util\MimeTypes;
use BaiduBce\Http\HttpHeaders;
use BaiduBce\Services\Bos\BosClient;
$BOS_TEST_CONFIG =
array(
'credentials' => array(
'accessKeyId' => '111111111',
'secretAccessKey' => '222222222',
),
);
//新建BosClient
$client = new BosClient($BOS_TEST_CONFIG);
$bucketName = 'test';
$objectKey = '2/222.png';//上传后的文件名
$fileName = '1.png';//本地文件名$res = $client->putObjectFromFile($bucketName, $objectKey, $fileName);var_dump($res);
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货