繁体   English   中英

如何使用php获取Google驱动器中文件的文件ID

[英]how to get the file id of a file in google drive using php

嗨,我一直在googling有关如何使用php将文件上传到google driveid的问题。到目前为止,每个上传的文件都是唯一命名的,我已经找到了这个答案,但这是针对python ..但是我想要一个php 如何在python Google驱动器API中获取fileID或parentID? 另一个虽然是为php而设计的,但是我不知道如何使它工作。https://developers.google.com/drive/v2/reference/files/insert任何帮助将不胜感激。

答案就在问题上。

转到您引用的页面,您会发现

  $createdFile = $service->files->insert($file, array(
      'data' => $data,
      'mimeType' => $mimeType,
    ));

    // Uncomment the following line to print the File ID
    // print 'File ID: %s' % $createdFile->getId();

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM