Movefile inside internal memory to externalrootdirectory

$cordovaFile.moveFile(cordova.file.externalRootDirectory, “Filename”, cordova.file.externalRootDirectory, “Directory Name”)
.then(function (success) {
alert(“success”);
}, function (error) {

   		alert("error");
	
  }); 

This code is not working from my side.

What is the error that you are getting

invalid modification error, shows me

Try adding following line to config.xml

<preference name=“AndroidPersistentFileLocation” value=“Compatibility” />
<preference name=“AndroidExtraFilesystems” value=“sdcard,cache” />

and

<uses-permission android:name=“android.permission.WRITE_EXTERNAL_STORAGE” />
to AndroidManifest.xml

Thanks It’s working fine