Reputation: 1065
Question:
Iam building an offline web application using html5 and pouchdb.
I have to display how much storage space is used by application and how much space is left for my application to use.
I did check the pouchdb tutorials and api to find if there is any information around it. But couldn't find any info
Upvotes: 1
Views: 688
Reputation: 11620
Browser vendors unfortunately don't expose this information anywhere. It's really very mysterious. Even in the case of Safari's WebSQL, where they give you "allowances" of 5MB, 10MB, 50MB, etc., it's not clear how they calculate those megabytes. I've seen databases that were effectively the same size take up different amounts of space according to Safari's calculations, e.g. because they opened more database names (even if those databases were immediately deleted afterwards). Weird stuff.
Maybe the HTML5 Quota Management API (currently in draft) will help some day.
Upvotes: 2