我将图像从服务器保存到设备上的本地路径
downLoad() {
this.http.downloadFile('http://example.com/files/files/image.jpg', {}, {}, 'image.jpg')
.then(data => {
console.log(data) ;
})
.catch(error => {
console.log(error) ;
});
}但图像不保存在照片库中。它是如何修复的?
发布于 2017-06-24 03:53:10
你可以使用这个插件:https://github.com/terikon/cordova-plugin-photo-library
添加插件后,您可以像这样保存图片:
var url = 'file:///...'; // file or remote URL. url can also be dataURL, but giving it a file path is much faster
var album = 'MyAppName';
cordova.plugins.photoLibrary.saveImage(url, album, function (libraryItem) {}, function (err) {});https://stackoverflow.com/questions/44717511
复制相似问题