0 Replies Latest reply on Mar 11, 2017 8:50 AM by manuelb43834097

    phonegap build create persistent folder

    manuelb43834097

      hi everyone,

      i would like to create a persistent folder when install my app on mobile or tablet, i found some snippet like this

       

      function onRequestFileSystemSuccess(fileSystem) { 
              var entry=fileSystem.root; 
              entry.getDirectory("folderexample", {create: true, exclusive: false}, onGetDirectorySuccess, onGetDirectoryFail); 
      } 
      
      
      function onGetDirectorySuccess(dir) { 
            console.log("Created dir "+dir.name); 
      } 
      
      
      function onGetDirectoryFail(error) { 
           console.log("Error creating directory "+error.code); 
      } 
      function OnDeviceReady(){
      window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onRequestFileSystemSuccess, null); 
      
      }
      document.addEventListener("deviceready", OnDeviceReady, false);
      

       

       

      but sometimes wrong, can you help me?

       

      thanks a lot