Kopieren einer Datei mithilfe von Cordova

Ich habe versucht, kopieren Sie die Datei namens versions.txt von applicationDirectory zu externalApplicationStorageDirectory mithilfe von cordova, aber code nicht.

hier ist der code

var path = cordova.file.applicationDirectory + "www/Data/versions.txt";

      window.resolveLocalFileSystemURL(path,
      function gotFile(fileEntry)
      {

          window.requestFileSystem(LocalFileSystem.PERSISTENT, 0,
              function onSuccess(fileSystem)
              { 
                      var directory = new DirectoryEntry("versions.txt", path);

                      fileEntry.copyTo(directory, 'versions.txt',
                          function()
                          {
                              alert('copying was successful')
                          },
                          function()
                          {
                              alert('unsuccessful copying')
                          });

              }, null);
      },null);

Hilfe?

InformationsquelleAutor Burcu Saner | 2015-07-21
Schreibe einen Kommentar