i have tried everything i can but still not able to get the code working for uploading images to firebase storage from my ionic 1 app , got this error FileError {code: 1, message: “NOT_FOUND_ERR”}
, here is the code exactly from your github repo `$scope.getPhoto=function () {
var fileName, path;
//loadData();
var options = {
quality: 80,
destinationType: Camera.DestinationType.FILE_URI,
sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
allowEdit: true,
encodingType: Camera.EncodingType.JPEG,
popoverOptions: CameraPopoverOptions,
saveToPhotoAlbum: false,
correctOrientation: true,
targetWidth :90,
targetHeight :90
};
$cordovaCamera.getPicture(options)
.then(function (results) {
console.log('Image URI: ' + results[0]);
// lets read the image into an array buffer..
// see documentation:
// http://ngcordova.com/docs/plugins/file/
fileName = results[0].replace(/^.*[\\\/]/, '');
// modify the image path when on Android
if ($ionicPlatform.is("android")) {
path = cordova.file.cacheDirectory
} else {
path = cordova.file.tempDirectory
}
alert(fileName)
alert(path)
return $cordovaFile.readAsArrayBuffer(path, fileName);
}).then(function (success) {
// success - get blob data
var imageBlob = new Blob([success], { type: "image/jpeg" });
// missed some params... NOW it is a promise!!
alert ("before saveToFirebase method")
return saveToFirebase(imageBlob, fileName);
alert ("saveToFirebase method")
}).then(function (_responseSnapshot) {
// we have the information on the image we saved, now
// let's save it in the realtime database
alert("beforesaveref")
return saveReferenceInDatabase(_responseSnapshot)
alert("saveref")
}).then(function (_response) {
alert("Saved Successfully!!")
}, function (error) {
// error
alert(JSON.stringify(error))
console.log(error)
});
}