Skip to content Skip to sidebar Skip to footer

$cordovafile Removefile & Checkdir Error 5 (encoding_err)

I am trying to use $cordovaFile to delete files from an Android device. The file to be deleted was downloaded using $cordovaFileTransfer in the following location. ft.download(url,

Solution 1:

This issue was resolved by using the LocalFileSystem. It is not as elegent as the methods provided by the file plugin, but it works.

var uri = cordova.file.externalDataDirectory + "episodes/";

window.resolveLocalFileSystemURL(uri, function(dir) {
        dir.getFile(episodeId + ".mp3", { create: false }, function(file) {
            file.remove(successCallback, errorCallback);
        });
}, errorCallback);

Post a Comment for "$cordovafile Removefile & Checkdir Error 5 (encoding_err)"