Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML 5 filesystem access Type Error

I'm working on a webapp and I'm trying to access directories using the filesystem API. I need to request a quota from the user before accessing the directories according to specification. I should do something like this:

...
navigator.webkitPersistentStorage.requestQuota(PERSISTENT, 1024*1024, 
function(gB){
   window.requestFileSystem(PERSISTENT, gB, onInitFs, errorHandler);
}, function(e){
   console.log('Error', e);
})
...

Everytime I do this I get a **TypeError: Type error** message. Please what am I doing wrong? Thanks in advance.
NB: onInitFs and errorHandler have been defined I just didn't include the code here.

like image 895
Jesse T-Cofie Avatar asked Jun 14 '13 20:06

Jesse T-Cofie


1 Answers

I was having the same issues and someone posted the solution, found at filesystem-api-not-working-in-chrome-v27-v29

navigator.webkitPersistentStorage.requestQuota(1024*1024, 
  function(gB){
  window.requestFileSystem(PERSISTENT, gB, onInitFs, errorHandler);
}, function(e){
  console.log('Error', e);
})

You have to remove the PERSISTENT from navigator.webkitPersistentStorage.requestQuota(...)

like image 137
Arthur Weborg Avatar answered Sep 24 '22 19:09

Arthur Weborg