1

谁能告诉我如何从Google Drive访问 My Drive 的所有文件和文件夹。

我在用 :

$client = new Google_Client();
// Get your credentials from the APIs Console
$client->setClientId('1095973606032-jkkjsp0ja5qdvp6f8p629964a2n0aqpn.apps.googleusercontent.com');
$client->setClientSecret('1Tkpr3IVYX5n7YtwR_cI3Sui');
$client-    >setRedirectUri('http://staging.test.jbiprojects.co.uk/google_drive/drive.php');
$client->setScopes('https://www.googleapis.com/auth/drive.file');

$service = new Google_DriveService($client);

$authUrl = $client->createAuthUrl();

我在这里做错了什么吗?

4

1 回答 1

0

Check out the Google Drive SDK PHP Quickstart. It will get you up and running if you copy-paste the code.

Instead of uploading a file, you should make a call to:

$service->files->list

Check out the PHP sample for files.list here.

于 2013-01-31T16:47:52.523 回答