You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/07/06 16:10:52 UTC

[GitHub] [cordova-plugin-file] mese79 commented on issue #303: FILE NOT FOUND When external file requested

mese79 commented on issue #303: FILE NOT FOUND When external file requested
URL: https://github.com/apache/cordova-plugin-file/issues/303#issuecomment-508937209
 
 
   I have the same issue with latest cordova file plugin and android 8.  
   ```
   var fileName = window.cordova.file.applicationStorageDirectory + 'databases/some.db'
   var directoryName = window.cordova.file.externalRootDirectory
   
   window.resolveLocalFileSystemURL(fileName, (file) => {
       console.log('[!] Database exists: ' + fileName);
       console.log('[!] Storage: ' + directoryName);
   					
       window.resolveLocalFileSystemURL(directoryName, (directory) => {
           console.log('[!] Directory: ' + directory.toURL());
   						
           directory.getDirectory("backup", {create: false, exclusive: false}, (directoryBackup) => {
   	    console.log('[!] Directory: ' + directoryBackup.toURL());
   	    file.copyTo(directoryBackup, name, (copiedFile) => {
                    console.log('[!] Copy success');
   	    }, (error) => {
   		 console.log('[!] Copy failed: ' + error.code);
   	    })
   						
   	}, (error) => {
               console.log('[!] Backup Directory not found: ' + directoryName + 'Backup' + ' errorcode: ' +  + error.code);
   	})
   					
       }, (error) => {
   	console.log('[!] Directory not found: ' + directoryName + ' errorcode: ' +  + error.code);
       })
   }, (error) => {
       console.log('[!] Database not found: ' + fileName + ' errorcode: ' +  + error.code);
   })
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org