Skip to content

Instantly share code, notes, and snippets.

@hiddenpearls
Created September 6, 2015 18:21
Show Gist options
  • Save hiddenpearls/e8c0e53d93a9db9bd3f5 to your computer and use it in GitHub Desktop.
Save hiddenpearls/e8c0e53d93a9db9bd3f5 to your computer and use it in GitHub Desktop.
Google Drive APIs with PHP - List all files and folders
function listAllFiles($driveService){
$parameters = array(
'maxResults' => '100'
);
$results = $driveService->files->listFiles($parameters);
echo '<table>';
foreach($results->getItems() as $file){
echo '<tr><td><img src="'. $file->iconLink .'"/> ' . $file->title . '</td></tr>';
}
echo '</table>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment