Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

Stuck solution for my cordovaFile / cordovaFileTransfer trial, still Error

$
0
0

@mridho wrote:

Anybody success to use the plugin cordovaFile & cordovaFileTransfer?

I have failed to understand and failed miserably execution. Case wants to make the upload and download controller. Each tested via the browser, it always appears File / FileTransfer is not defined in Firebug. When I made to console.log as:

console.log($cordovaFile); or
console.log($cordovaFileTransfer); or
console.log($cordovaFileTransfer.download); or
console.log($cordovaFileTransfer.upload);

Its return true, form of the {object}.

But when I call their methods included parameters, for example:

$cordovaFileTransfer.download (urlServer, fileTarget, {}, true);

Direct emerge error: FileTransfer is not defined.

I tried to move the download function to the Service, and then Controller call the function (the umpteenth time search results on google). The result is just the same, the above error.

Because there are user in some forum said should / could only be tested through the device, finally I try to upload ionic.io & I sync via APL ionic view on my Smartphone. But the result is NOTHING.

I tried to improvise a little, try method checkDir / checkFile as follows:

.controller('PhotoCtrl', function($scope, $cordovaFile) {
  $scope.downpic = function(){
    $cordovaFile.checkDir("/sdcard/storage/emulated/0/").then(function(result){
      alert("wow");
    }, function(err){
      alert("eror");
    });
  }
})

It turns out alerts that appear "error", I try mutually value directory is as follows:

file///sdcard/storage/emulated/0/
file///storage/emulated/0/
/storage/emulated/0/

Just the same error alerts, the chain problem. My question :

  1. What is the application of ionic cordova can access the internal storage? (I only have the Mobile Internal Storage, without External Storage);

  2. I was looking for information about AndroidManifest.xml uses-permission, the permission is only for external storage. Are there any other analysis?

Please help, really newbie

Posts: 2

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles