【问题标题】:How to download picture in ios gallery with phonegap?如何使用phonegap在ios图库中下载图片?
【发布时间】:2012-10-31 16:00:23
【问题描述】:

我有问题。 我想用 phonegap cordova 2.1 下载图片并将它们显示在苹果 iphone/ipad 画廊中。 我已经测试了这个javascript函数

$("#btnDL").click(function(){
    var file = $("#imgViewer img").attr('src');
    var aux =file.split('/');
    var fName = aux[aux.length - 1];

    var fileTransfer = new FileTransfer();

    fileTransfer.download(encodeURI(file),"/var/mobile/Applications/9A25FA0A-49A9-4DED-BD83-5FF043A9075/Document/MyApplicationName",function(entry){
        alert("Image saved in "+entry.fullPath);
    },function(error){
        alert("ERR: "+JSON.stringify(error));
    });
});

该功能告诉我文件已保存在我的 iPad 中。但是如果我在画廊中搜索,有任何图片。我曾想过在 Objective-C 中做一个插件,但我对这种语言了解得不够多。 我已经测试过用这个做一个插件

http://blog.clearlyinnovative.com/post/1097750723/phonegap-plugin-for-downloading-url

还有这个

https://github.com/aaronksaunders/FileDownLoadApp

但他们没有工作。

【问题讨论】:

    标签: javascript ios cordova download image


    【解决方案1】:

    终于我用这个插件解决了我的问题

    https://github.com/devgeeks/Canvas2ImagePlugin

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-02-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-11-07
      相关资源
      最近更新 更多