Last active
December 17, 2016 12:53
-
-
Save plehr/0503f55f200f8fe3a61e3143d6e685f7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function newfolder($drive_service){ | |
$fileMetadata = new Google_Service_Drive_DriveFile(array( | |
'name' => 'Testordner', | |
'mimeType' => 'application/vnd.google-apps.folder')); | |
$file = $drive_service->files->create($fileMetadata, array( | |
'fields' => 'id')); | |
printf("Folder ID: %s\n", $file->id); } | |
function ($drive_service) { | |
$folderId = 'xxxxxxxxxxx'; | |
$fileMetadata = new Google_Service_Drive_DriveFile(array( | |
'name' => 'test.pdf' | |
)); | |
$content = file_get_contents('doc.pdf'); | |
$file = $drive_service->files->create($fileMetadata, array( | |
'data' => $content, | |
'mimeType' => 'application/pdf', | |
'uploadType' => 'multipart', | |
'fields' => 'id')); | |
printf("File ID: %s\n", $file->id);} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment