Issue
Downloading images using cordova.file
into dataDirectory
. I am saving files into internal app folder. In the emulator I am able to see the downloaded files but on real device I am not able to see the downloaded file. This is my path look like
not able to see this image into app folder.
$scope.Download = function () {
var FileURL = appService.downloadFiles($scope.selectedFile.FileKey);
var targetPath = cordova.file.dataDirectory + "ChatApp/" + $scope.selectedFile.FileName;
var trustHosts = true;
var options = {};
$cordovaFileTransfer.download(FileURL, targetPath, options, trustHosts)
.then(function (result) {
alert('file downloaded successfully');
console.log(result);
refreshMedia.refresh(targetPath);
}, function (err) {
console.log(err);
}, function (progress) {
console.log(progress);
});
};
}
Does it required any permission to create folder inside cordova.file.dataDirectory
. How I see this file inside the internal app folder.
Solution
You are using cordova.file.dataDirectory
. In real device you can not access this folder using file manager/third party application. This is for security reason. If you want to see the downloaded file then use cordova.file.externalDataDirectory
instead of cordova.file.dataDirectory
. Then you can see the file inside application folder which is located inside internal memory.
Answered By - Homen
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.