Dropbox API: how can I get the amount of remaining free space?

狂风中的少年 提交于 2019-12-08 05:55:28

问题


It seems to me that the Dropbox API lacks the ability to tell the remaining available free space for the linked Dropbox account. I can only get the total quota of the user, by using the .accountInfo() call.

The only way I see is to iterate over all the files the user stores in Dropbox, and sum up their sizes, then subtract this amount from the total quota. This solutions seems quite terrible and slow, is there a better way to this?

As a sidenote, I attempt to do this on Android, but I don't think that this is a platfrom-dependent question.


回答1:


The documentation for the /account/info call state:

quota_info/normal The user's used quota outside of shared folders (bytes).

quota_info/shared The user's used quota in shared folders (bytes).

quota_info/quota The user's total quota allocation (bytes).

So, the free space should just be:

quota - normal - shared


来源:https://stackoverflow.com/questions/14853410/dropbox-api-how-can-i-get-the-amount-of-remaining-free-space

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!