android - Stuck solution for my cordovaFile / cordovaFileTransfer trial, still Error -


anybody success use plugin cordovafile & cordovafiletransfer?

i have failed understand , failed miserably execution. case wants make upload , download controller. each tested via browser, appears file / filetransfer not defined in firebug. when made 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 {object}.

but when call methods included parameters, example:

$cordovafiletransfer.download (urlserver, filetarget, {}, true); 

direct emerge error: filetransfer not defined.

i tried move download function service, , controller call function (the umpteenth time search results on google). result same, above error.

because there user in forum said should / tested through device, try upload ionic.io & sync via apl ionic view on smartphone. result nothing.

i tried improvise little, try method checkdir / checkfile 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 appear "error", try mutually value directory follows:

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

just same error alerts, chain problem. question :

  1. what application of ionic cordova can access internal storage? (i have mobile internal storage, without external storage);
  2. i looking information androidmanifest.xml uses-permission, permission external storage. there other analysis?

please help, newbie

finally, got clear solution link below :

https://blog.nraboy.com/2014/09/manage-files-in-android-and-ios-using-ionicframework/


Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -