Start a new topic

copy from directory assets-library to localhost/persistent

copy from directory assets-library to localhost/persistent


Hi all,

 

I need help to transfert files from the assets dir into persistent directory on Ios: 

This is my code but I recive error 1.

resolveLocalFileSystemURL("assets-library://www",
                                      function (dirSrc) {
                                        console.log("Name:"+dirSrc.name);
                                        console.log("Full Path:"+dirSrc.fullPath);
                                      
                                        resolveLocalFileSystemURL("cdvfile://localhost/persistent",
                                                                function (dirDest) {
                                                                    console.log("Name Dest:",dirDest.name);
                                                                    console.log("Full Path Dest:",dirDest.name);
                                                                  
                                                                    dirSrc.copyTo(dirDest,"www",
                                                                                  function (entry) {
                                                                                    console.log("New Path: " + entry.fullPath);
                                                                                    Cms.readBookmarkPhoneGap();
                                                                                    Cms.downloadImages();
                                                                                  },
                                                                                  function (e) {console.error("errore:"+e.code);});
                                                                },
                                                                function (){console.error("errore");});
                                      
                                      },
                                      function (){console.error("errore");});
            
  What is wrong?

Thanks all.      

Hi pierre,
Unfortunately I can't help you with PhoneGap specific questions that do not concern our Plugin. 

Do you also have a error message? Usually file copy error are either because of a invalid source (there is no such file to copy), invalid destination (maybe an intermediate directory does not exist) or you don't have permissions to copy the file into the destination.

Best regards

Andreas

 

 
Login or Signup to post a comment