

$file->setMimeType('application/vnd.google-apps. To create new folder, we need to set the mime type Manipulate with the files and folders on the Google Drive via the Google Drive API. The docs mention this: If the file isnt shared publicly, the URL returned in Files.thumbnailLink must be fetched using a credentialed request. Move files or folders into a shared drive. Learn more about sharing items in shared drives. Im doing this in an app running from localhost. Ask your admin to use the Drive API to share the child folder after the parent. $file = new Google_Service_Drive_DriveFile() 1 hour ago &0183 &32 Im trying to render the thumbnailLink image returned from the Google Drive APIs /files endpoint. $folderID = $files->getId() // the first element $files = $service->files->listFiles($parameters) creates a folder in the given rootID or returns the ID if it already existsįunction createFolderIfNotExists($service, $rootID, $foldername) ' in parents AND mimeType = 'application/' AND trashed != true"

$service = new Google_Service_Drive($client) ĬreateFolderIfNotExists($service, $rootID, "stackfolder") set various parameters, including name, key and secret In Google Drive, a folder is a special file type ( application/ that is), see their API documentation for more information. I don't know if I understood your question correctly but in order to create a folder in the root of Google Drive programmatically, you may want to use the following code.
