Vive Vive - 11 days ago 10
iOS Question

Size of the folder in Google Drive

I've browsed the documentation & searched in code. Is there any way to get the size of the folder and it's contents in Google Drive SDK for iOS?

The

GTLDriveFile
has a property
fileSize
, but it's
0
for folders. The
properties
property is
nil
. Where can I look for it?

Maybe I should compose a new query for it?

Answer

@Vive, based on this documentation Working with Folders,

Folders are specialized files with metadata but no content. There are a number of additional operations that can be used on folders to query and manage child entries.

As stated from this previous SO question, "You are getting the size of the folder object, not its contents. The api doesn't support getting a folder content's size. You need to recursively calculate it, using appengine task queues for example."

I hope this helps you create a workaround the query you need.