@Kawahara wrote:
Hello everyone!
So I've been writing an app, which downloads images from AWS and sets it in the view, asThe code I am using is below:
function DownloadImages($localstorage, $cordovaFile, $ionicPlatform, $ionicLoading) {
var vm = this;
var test = {};vm.createDirectoryForImages = function (directory) { $ionicPlatform.ready(function () { }).then(function () { $cordovaFile.createDir(cordova.file.dataDirectory, directory, true) .then(function (entry) { }, function (error) { alert("Could not create directory: " + error.status); }) }); }; vm.download = function (directory, filename) { $ionicLoading.show({ template: '<ion-spinner icon="spiral"></ion-spinner> </br>Downloading...' }); var hike = JSON.parse($localstorage.get("hikelistandinformation")); var url = hike.photosUrl + "1.png"; vm.createDirectoryForImages(directory); $ionicPlatform.ready(function() { }).then(function() { var ft = new FileTransfer(); ft.download(url, cordova.file.dataDirectory + directory + "/" + filename, function successfullyDownloaded(entry) { return entry.toURL(); $ionicLoading.hide(); }, function error(error) { $ionicLoading.hide(); alert("Download error: " + error); }, true, {}); }); //fileTransfer.download(url, cordova.file.dataDirectory + "LanikaiPillbox") }; }
However, whenever I try to set the image source as the entry url, nothing appears on the view. I have tried toInternalURL(), and fullPath(), but nothing seems to work.
Any advice would be greatly appreciated! Thanks in advance!
Posts: 2
Participants: 1