[英]Get size of files with Google Drive API v3
I'm extracting some data from the drive API: 我正在从驱动器API中提取一些数据:
response = service.files().list(q=q_parameter, spaces='drive', fields='nextPageToken, files(id, name,mimeType, webViewLink, owners, capabilities, createdTime, modifiedTime, size)', pageToken=page_token).execute()
I'm saving the response in a JSON file, but the size is not being saved... 我将响应保存在JSON文件中,但是没有保存大小...
Drive API documentation here . 在此处驱动API文档。
Any ideas? 有任何想法吗? Thanks.
谢谢。
Use fields * and it will download all of the metadata. 使用字段*,它将下载所有元数据。 If you hadent set up the limitation fields correctly the data would have returned null
如果您正确设置了限制字段,则数据将返回null
response = service.files().list(q=q_parameter, spaces='drive', fields='*', pageToken=page_token).execute()
I have found the problem! 我发现了问题! Everything works fine.
一切正常。 The native drive files don't take up space.
本机驱动器文件不占用空间。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.