Chrome Apps : How to save blob content to fileSystem in the background?
Chrome Application's sandbox storage doesn't allow files to be stored in root directory (i.e. /
)
Modify the code to save it in a specific sub-directory under it.For example -
fileSystem.writeBlob("/new"+response.name, response).then(function() { console.log("file saved"); }, function(err) { console.log(err); });
This would successfully save the file under /new/
directory.
To expand on this, here is a full example app on how to download a file and save the blob and display it back to the user.