Once download, images not display in android gallery?

Hello there,

I am using $cordovaFileTransfer plugin for image file download, it working fine but after downloaded images not seen in android gallery. i have write below code in my file download controller.

$scope.downloadFile = function(url) {

        var filename = url.split("/").pop();
        var targetPath = cordova.file.externalRootDirectory+'test/'+filename;
        var trustHosts = true
        var options = {};

        $cordovaFileTransfer.download(url, targetPath, options, trustHosts)
          .then(function(result) {
            // Success!
          }, function(error) {
            // Error
          }, function (progress) {
            $timeout(function () {
              $scope.downloadProgress = (progress.loaded / progress.total) * 100;

So, can you please tell me how to display downloaded image in android gallery?

1 Like

I’m no android developer … But at IOS its like this

you have an app folder and you have a camera folder (where all the pictures taken with the camera is stored). Pictures saved in the app folder won’t come up in the camera roll.

I think you just save the image to the app folder and not the camera library folder.

Thanks for reply,

Anyone know that, how to display downloaded images in gallery using cordova?

Thanks in advance

well you need to get the images from that folder (using cordova) then pass the absolute filename to the view for example