I use PHP to request seven cattle server to get Uploadtoken, the Uploadtoken to the JSON data output to the Android app upload images, using my own server to obtain the Uploadtoken can not upload pictures (http://nnddkj.com/ Laugh/seven ... ), I use an example of the official web site to generate Uploadtoken in the app can be used to upload pictures (http://jssdk.demo.qiniu.io/up ... ), I ask the gods, this is not the uploadtoken I get to the wrong ah, where I was mistaken? Here's how I use PHP to get Uploadtoken:
Require_once './autoload.php ';
Introduction of the Authentication class
Use Qiniuauth;
Introducing 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 server is using ubuntu14.0.1, PHP environment is used XAMPP integrated, php7.0, PHP site environment normal use. I downloaded the "PHP SDK download Address" This SDK, and then directly referenced the SDK autoload files, auth files, uploadmanager files, about the use of composer installation SDK This step is not familiar with, looked for several days, I executed this directive curl-ss Https://getcomposer.org/insta ... | PHP downloaded the software, and then according to composer official website to perform composer install installation completed, and the following two do not know how to use
2. Run the Composer command to install the latest stable version of the SDK:
php composer.phar require qiniu/php-sdk
3. Require Composer generated autoloader:
Reply content:
I use PHP to request seven cattle server to get Uploadtoken, the Uploadtoken to the JSON data output to the Android app upload images, using my own server to obtain the Uploadtoken can not upload pictures (http://nnddkj.com/ Laugh/seven ... ), I use an example of the official web site to generate Uploadtoken in the app can be used to upload pictures (http://jssdk.demo.qiniu.io/up ... ), I ask the gods, this is not the uploadtoken I get to the wrong ah, where I was mistaken? Here's how I use PHP to get Uploadtoken:
Require_once './autoload.php ';
Introduction of the Authentication class
Use Qiniuauth;
Introducing 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 server is using ubuntu14.0.1, PHP environment is used XAMPP integrated, php7.0, PHP site environment normal use. I downloaded the "PHP SDK download Address" This SDK, and then directly referenced the SDK autoload files, auth files, uploadmanager files, about the use of composer installation SDK This step is not familiar with, looked for several days, I executed this directive curl-ss Https://getcomposer.org/insta ... | PHP downloaded the software, and then according to composer official website to perform composer install installation completed, and the following two do not know how to use
2. Run the Composer command to install the latest stable version of the SDK:
php composer.phar require qiniu/php-sdk
3. Require Composer generated autoloader: