What are the details can be obtained from webkitStorageInfo.queryUsageAndQuota()

后端 未结 3 1647
悲哀的现实
悲哀的现实 2021-01-20 19:28

webkitStorageInfo.queryUsageAndQuota() is used to find out the usage stats of the files that have been stored in the file system using the HTML5 file system API I suppose. C

3条回答
  •  一向
    一向 (楼主)
    2021-01-20 20:05

    // Request storage usage and capacity left
    window.webkitStorageInfo.queryUsageAndQuota(webkitStorageInfo.TEMPORARY, //the type can be either TEMPORARY or PERSISTENT
    function(used, remaining) {
      console.log("Used quota: " + used + ", remaining quota: " + remaining);
    }, function(e) {
      console.log('Error', e); 
    } );
    

    Where used and remaining are in bytes

    Taken from google devlopers

提交回复
热议问题