芝麻web文件管理V1.00
编辑当前文件:/home/mgatv524/public_html/avenida/vendor/xibosignage/oauth2-xibo-cms/example/file.php
'p8kh8tq2mknOqMFx7qcgl7FGtFGDlDAlDOxb6TP1', // The client ID assigned to you by the provider 'clientSecret' => 'KjHPCQHm0ztqA4bcqP1dszYpLpcZqyAvaFlGbFZsq6HUn15ND8d8bZZhpFiPHWqMOQx5sXsAPgdtahICgtdhgFxxOAtlv59kl1GZZLe6dRNvOYQLQyXP9NtxfQkHgHj2wmJwhhhBwqvyPnp9pn13eevMCbDnqfyZJzMkUoG3fofxQPq6Kl9Mh5DtFtiEgXs2XE7zhKfGPOLWH1pUZxn3FLixOehSRUyuUB7SLDqnulPxlFMbV6L4EN4pAG5cRN', // The client password assigned to you by the provider 'redirectUri' => '', 'baseUrl' => 'http://192.168.0.28' ]); if (!isset($argv[1])) { $token = $provider->getAccessToken('client_credentials')->getToken(); echo 'Token for next time: ' . $token; } else $token = $argv[1]; try { // Prepare a file upload $guzzle = $provider->getHttpClient(); $response = $guzzle->request('POST', 'http://192.168.0.28/api/library', [ 'headers' => [ 'Authorization' => 'Bearer ' . $token ], 'multipart' => [ [ 'name' => 'name', 'contents' => 'API upload 2' ], [ 'name' => 'files', 'contents' => fopen('files/h264.mp4', 'r') ] ] ]); // Get both echo 'Body: ' . $response->getBody() . PHP_EOL; } catch (\GuzzleHttp\Exception\RequestException $e) { echo 'Client Exception: ' . $e->getMessage() . PHP_EOL; if ($e->hasResponse()) { echo $e->getResponse()->getBody() . PHP_EOL; } }