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

문제

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.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top