How can I move a file using the URL I get from the Camera?
neither successCallback nor errorCallback is called by the function moveTo. Can anyone tell me what I am d
You're trying to call the function moveTo on a String.
moveTO is not a function of String but of fileEntry. So first thing you need to do is get a fileEntry from your URI.
For that you'll call window.resolveLocalFileSystemURL :
function moveFile(fileUri) {
window.resolveLocalFileSystemURL(
fileUri,
function(fileEntry){
newFileUri = cordova.file.dataDirectory + "images/";
oldFileUri = fileUri;
fileExt = "." + oldFileUri.split('.').pop();
newFileName = guid("car") + fileExt;
window.resolveLocalFileSystemURL(newFileUri,
function(dirEntry) {
// move the file to a new directory and rename it
fileEntry.moveTo(dirEntry, newFileName, successCallback, errorCallback);
},
errorCallback);
},
errorCallback);
}