How do I get the amount of free disk space in PhoneGap?
I would like to store a significant amount of data on a device's nonvolatile storage开发者_开发知识库 in PhoneGap. How do I get the amount of available space so I can warn the user if there is not enough?
Instead of asking for the total available space, you can pass the amount of space you need as the second argument to window.requestFileSystem (unsigned short type, unsigned long long size, FileSystemCallback successCallback, optional ErrorCallback errorCallback);
. This may be more useful anyway, as the user agent may have per-application storage quotas or be able to present a permissions dialog "May this application use 10 megabytes of storage?".
精彩评论