Get size of file created on Google drive using Goo

2019-03-04 05:53发布

问题:

I have created application using which user will able to get all files in list from Google drive and will be able to download it.

Now User can download files which he has uploaded to drive with progress count. but I could not get size of files that are created on Goolge drive e.g Documents,Presentation,Spreadsheet ..etc . still user can download those files.I want to show progress bar from 1 to 100 while downloading for those files.But I dont have filesize in long.

I have gone through Google drive api docs ,there is no filesize parameter for Google drive files.Doc says "This is only populated for files with content stored in Drive." here

Google drive API Docs

Please help me to fix this small problem. Thanks in advance.

回答1:

You can't get the size because Google doesn't know it for Google docs files (doc, ssheet, etc). If you download them, you are actually downloading an export file which is created dynamically.