I use php to request the Qiniu server to obtain the uploadToken, and provide the uploadToken as json data output to the Android APP to upload pictures. However, I cannot upload pictures using the uploadToken obtained from my own server (http://nnddkj.com/laugh/seven... ), I used an example on the official website to generate the uploadToken, which can be used to upload images in the APP (http://jssdk.demo.qiniu.io/up...). May I ask the experts, is this the uploadToken I obtained? That's not correct. Where did I go wrong? Here is how I use php to get the uploadToken:
require_once './autoload.php';
//Introduce the authentication class
use QiniuAuth;
//Introduce the upload class
use QiniuStorageUploadManager;
$bucket = 'space name';
$accessKey = 'ak';
$secretKey = 'sk';
$auth = new Auth($accessKey, $secretKey);
$upToken = $auth->uploadToken($bucket);
$updateToken=array('id'=>1,'updateToken'=>$upToken);
echo json_encode($updateToken);
My The server uses ubuntu14.0.1, the php environment is integrated using xampp, php7.0, and the php website environment can be used normally. I downloaded the SDK "PHP SDK download address", and then directly referenced the autoload file, Auth file, and UploadManager file in the SDK. I was not familiar with the steps of using Composer to install the SDK. After watching it for several days, I executed this Command curl -sS https://getcomposer.org/insta... | php to download the software, and then execute composer install according to the Composer official website to complete the installation. There are still two things below that I don’t know how to use
2. Run the Composer command to install Latest stable version of SDK:
<code>php composer.phar require qiniu/php-sdk</code>
3. Autoloader generated by Require Composer:
<code><?php require 'vendor/autoload.php'; 是不是我没有安装SDK才获取的uploadToken不能上传图片呢?</code>
I use php to request the Qiniu server to obtain the uploadToken, and provide the uploadToken as json data output to the Android APP to upload pictures. However, I cannot upload pictures using the uploadToken obtained from my own server (http://nnddkj.com/laugh/seven... ), I used an example on the official website to generate the uploadToken, which can be used to upload images in the APP (http://jssdk.demo.qiniu.io/up...). May I ask the experts, is this the uploadToken I obtained? That's not correct. Where did I go wrong? Here is how I use php to get the uploadToken:
require_once './autoload.php';
//Introduce the authentication class
use QiniuAuth;
//Introduce the upload class
use QiniuStorageUploadManager;
$bucket = 'space name';
$accessKey = 'ak';
$secretKey = 'sk';
$auth = new Auth($accessKey, $secretKey);
$upToken = $auth->uploadToken($bucket);
$updateToken=array('id'=>1,'updateToken'=>$upToken);
echo json_encode($updateToken);
My The server uses ubuntu14.0.1, the php environment is integrated using xampp, php7.0, and the php website environment is used normally. I downloaded the SDK "PHP SDK download address", and then directly referenced the autoload file, Auth file, and UploadManager file in the SDK. I was not familiar with the steps of using Composer to install the SDK. After watching it for several days, I executed this Command curl -sS https://getcomposer.org/insta... | php to download the software, and then execute composer install according to the Composer official website to complete the installation. There are still two things below that I don’t know how to use
2. Run the Composer command to install Latest stable version of SDK:
<code>php composer.phar require qiniu/php-sdk</code>
3. Autoloader generated by Require Composer:
<code><?php require 'vendor/autoload.php'; 是不是我没有安装SDK才获取的uploadToken不能上传图片呢?</code>