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 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…