ответ

0

Вы можете найти здесь http://ionicframework.com/docs/v2/native/base64-to%20gallery/

http://ourcodeworld.com/articles/read/80/how-to-convert-a-image-from-the-device-to-base64-with-javascript-in-cordova

https://cordovablogsblogs.wordpress.com/2015/05/29/phonegap-plugin-to-convert-base64-string-to-a-png-image-in-android/

Reference code from here

window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function (fileSystem) { 

    var fileTransfer = new FileTransfer(); 
    var uri = encodeURI("http://www.example.com/image"); 
    var path = fileSystem.root.toURL() + "appName/example.jpg"; 

    fileTransfer.download(
    uri, 
    path, 
    function(entry) { 
     refreshMedia.refresh(path); // Refresh the image gallery 
    }, 
    function(error) { 
     console.log(error.source); 
     console.log(error.target); 
     console.log(error.code); 
    }, 
    false, 
    { 
     headers: { 
     "Authorization": "dGVzdHVzZXJuYW1lOnRlc3RwYXNzd29yZA==" 
     } 
    } 
); 

}); 
+0

Момент вар = URI encodeURI ("http://www.example.com/image"); Должен ли я передавать данные base64 –

+0

Да. он кодируется изображение – Developer

+0

https://github.com/Nexxa/cordova-base64-to-gallery – Developer