Search code examples
phpapigoogle-cloud-platformdrive

How can I get shared link with Google Drive Api in PHP


I am using google drive api with php. I do upload a file in new created folder. But i don't know "How can i get shared url for new folder". or "How can i give 'reader' permission for new email adress"?

I want to share folder. Not file


Solution

  • $result = $service->files->create(
        $file,
        array(
            'data' => file_get_contents($file_path),
            'mimeType' => 'application/octet-stream',
        )
    );
    

    File Id: $fileId = $result['id'];