Using Cordova-Plugin-File; Worked well in the past using strings like:
“Android/data/com.nsbasic.AppName/files/”
now The following Fails (fail1) with error code 2 (File Not Found?)
Dim gfolder = "Android/data/com.nsbasic.AppName/files/Photos" 'Directory to store the photo
Dim gPDFfolder = "Android/data/com.nsbasic.AppName/files/PDFs" 'Directory to store the photo
document.addEventListener("deviceready", onDeviceReady, False)
Function onDeviceReady()
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFileSys, fail0)
End Function
Function gotFileSys(fs)
gfileSystem = fs
gfileSystem.root.getDirectory(gfolder, {create: True, exclusive: False}, SubSuccess, fail1)
gfileSystem.root.getDirectory(gPDFfolder, {create: True, exclusive: False},
SubSuccessPDF, fail1)
navigator.splashscreen.hide()
End Function
Simply supplying strings to the plugin commands no longer function. I had supply the getDirectory() command this variation resolveLocalFileSystemURL(dataDirectory) + “Photos” before I was able to create the directory. I always used ABSOLUTE PATHS BEFORE.