Quota exceeded attempt to create file using HTML file API

In a packaged Chrome application, I try to read from a file in the PERSISTENT repository and create it if it does not exist:

window.webkitRequestFileSystem(PERSISTENT, 1024*1024, function(fileSystem) {
    fileSystem.root.getFile('file.txt', {create: true}, function(fileEntry) {
        fileEntry.file(function(file) {
            var reader = new FileReader();
            reader.onloadend = function(e) {
                console.log(this.result);
            };
            reader.readAsText(file);
         }, errorHandler);
    }, errorHandler);
});

But I get an error The operation failed because it would cause the application to exceed its storage quota.. TEMPORARY STORAGE gives me the same error. Is there anything I should point out in manifest.json?

+4
source share
1 answer

Adding unlimitedStoragemanifest.json to the permissions fixes the problem.

+12
source

Source: https://habr.com/ru/post/1532131/


All Articles