I was trying to create a file using the file system API in chrome. Initially I tried PERSISTENT storage as follows
window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem;
webkitStorageInfo.requestQuota(webkitStorageInfo.PERSISTENT, 1024*1024,
function(grantedBytes) {
window.requestFileSystem(webkitStorageInfo.PERSISTENT, grantedBytes, onInitFs,
errorHandler);
},
errorHandler);
It was working fine initially. But now when I try the same code is giving me the following error
NOT_SUPPORTED_ERR: DOM Exception 9
Then I tried TEMPORARY file storage as follows
window.requestFileSystem(TEMPORARY, 1024*1024, onInitFs, errorHandler);
That is giving me some FileError with the code 2 which means Security Error. Can anyone please help me on these issues?
Are you trying to place the code in a page that is stored on your local computer and run it with Chrome? Did you add the flag
--allow-file-access-from-files
in your Chrome shortcut? I happened to encounter the same error as yours and suddenly I realized that I forgot to add this flag to run my chrome.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With