I'm trying to set up a file storage for later use in Phonegap, but debugging in Chrome for now. Going the way as described on html5rocks only lets me request a quota from the user, but the callback when requesting the filesystem is not executed. See:
window.webkitStorageInfo.requestQuota(PERSISTENT, 1024*1024*1024, function(grantedBytes) {
requestFS(grantedBytes);
}, onError);
function requestFS(grantedBytes) {
window.webkitRequestFileSystem(window.PERSISTENT, grantedBytes, function(fs) {
// ... does not get called ###################################
}, onError);
}
Now Chrome warns me that webkitStorageInfo has been deprecated and there is a new standard out from today https://dvcs.w3.org/hg/quota/raw-file/tip/Overview.html. I tried using navigator.webkitPersistentStorage without success.
Is it possible the filesystem API is not working currently or has been deprecated or is possibly something wrong with my above code?
Below functions also don't do anything, no errors visible:
navigator.webkitPersistentStorage.queryUsageAndQuota(function(usage, quota) {
console.log(arguments);
navigator.webkitPersistentStorage.requestQuota(1024 * 1024, function(grantedQuota) {
console.log(arguments);
window.webkitRequestFileSystem(window.PERSISTENT, 1024 * 1024, function(fs) {
console.log(arguments);
});
});
});
UPDATE:
I got Filer by Eric Bidelman working, so something in my code must be wrong, though I can't see a difference between the Filer init method and what I'm doing.