无法使用Google Drive API获取fileExtension和fileSize [英] Unable to get fileExtension and fileSize using Google Drive API

查看:175
本文介绍了无法使用Google Drive API获取fileExtension和fileSize的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据此文件:
https://developers.google .com / drive / v2 / reference / files#resource
我可以得到 fileExtension fileSize in files Resource。



我使用这一行来获取文件元数据:

  $ files = $ service-> files-> listFiles(array('q'=>'\'USER_EMAIL \'在所有者中和\''PARENT_ID \\''在父母'中) ; 

查询是成功的,我得到数组 $ files ['items' ]



我可以得到kind的值,idtitlemimeType

但是我无法获得fileExtension的值fileSize(不存在于数组中)。



是否有任何设置或查询遗漏了?

解决方案

作为Google文档的一种文件类型存储的内容不包括 fileExtension fileSize fileExtension 在Google Docs上下文中不相关,Docs文件不占用任何Drive配额,因此文件具有 fileSize 属性为
$ b

文件资源文档包含以下详细信息: https://developers.google.com/drive/v2/reference/files#resource


According to this document : https://developers.google.com/drive/v2/reference/files#resource I can get fileExtension and fileSize in files Resource.

I am using this line to get files metadata :

$files = $service->files->listFiles(array('q' => '\'USER_EMAIL\' in owners and \'PARENT_ID\' in parents'));  

The query is successfull, I get the array $files['items'].

I can get the value of "kind", "id", "title", "mimeType", etc.
But I can't get the value of "fileExtension" and "fileSize" (not exist in array).

Is there any setting or query that I missed out?

解决方案

The content stored as one of the file types of the Google Docs doesn't include fileExtension and fileSize. fileExtension is not relevant in Google Docs context and Docs files don't consume any Drive quota therefore files have fileSize attribute is irrelevant for them too.

The Files resource docs include these details: https://developers.google.com/drive/v2/reference/files#resource

这篇关于无法使用Google Drive API获取fileExtension和fileSize的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆