[英]How to get the file URL uploaded in google drive SDK using php
我正在使用Google Drive SDK通過PHP上傳文件。 現在,我想以字符串形式獲取鏈接,以便可以將其存儲在數據庫中。 但是我對如何獲得它沒有任何想法..這是使用PHP在Google驅動器中創建文件的代碼。
$file = new Google_DriveFile();
$file->setTitle( 'new_pdf' );
$file->setMimeType( 'application/pdf' );
$createdFile = $service->files->insert( $file, array(
'data' => $stringContent,
));
您需要$ createdFile的屬性之一。
屬性列表位於https://developers.google.com/drive/v2/reference/files
您可能需要webContentLink
,但這取決於您打算如何使用URL。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.