If my app was granted FileSystem access, browser/computer shutdown and restarted, do I need to call "webkitRequestFileSystem" again?

StackOverflow https://stackoverflow.com/questions/17138763

Question

Everytime I want to access the filesystem, does my app need to call webkitRequestFileSystem? Or is there some way to persist the filesystem stored in a variable across shutdowns and restarts?

For example:

  1. Request Quote and the filesystem
  2. On granted, store the returned DOMFileSystem object in a variable
  3. User shuts down chrome and computer
  4. User starts chrome up again
  5. My app wants to access file system, what does it do?

It's a hosted app, but this question also applies to any web app I believe.

Was it helpful?

Solution

You will always need to request a FileSystem, if that's what you need. To use the same one each time use a PERSISTENT type when requesting the file system.

window.requestFileSystem  = window.requestFileSystem || window.webkitRequestFileSystem;
window.requestFileSystem(window.PERSISTENT, size, successCallback, opt_errorCallback);

There are other local storage options that might suit you better if making this request is too onerous.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top