问题
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