Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
262 views
in Technique[技术] by (71.8m points)

how to set video file as public in google drive and how to determine when finished processing ? using php

I am trying to create a PHP function that when a file path is given and also a folder name it will upload the file (99.9% of the time is video) and give me the link back.

I have managed to do all of these steps, the only problem is before going forward I noticed that I need to make the file public, also I need to wait until google drive finishes processing then proceed with the code, I am also using PHP.

any help is very much appreciated.

        $permission = new Google_Service_Drive_Permission();
        //$permission->setValue( 'me' );  //if i uncomment this i get error that method setvalue does not exist
        $permission->setRole( 'reader' );
        $permission->setType( 'anyone' );
        try {
           $a = $service->permissions->create($result->getId(), $permission);
        } catch (Exception $e) {
          print "An error occurred: " . $e->getMessage();
        }
        echo $publicOriginallink = "https://drive.google.com/file/d/".$result->getId()."/view";

even after executing this the status of the file does not change and still stays private

Uncaught Error: Call to undefined method Google_Service_Drive_Permission::setValue()

question from:https://stackoverflow.com/questions/65878717/how-to-set-video-file-as-public-in-google-drive-and-how-to-determine-when-finish

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...