【问题标题】:FileTransfer in Phonegap code 401Phonegap 代码 401 中的文件传输
【发布时间】:2012-07-24 07:00:39
【问题描述】:

嘿,我正在使用 Phonegap 的 FileTransfer。我收到 401 代码 3 错误(未经授权)httprequest。

我的FT方法的实现:

    var ft = new FileTransfer();
    ft.download(startUrl + filename, dlPath, function(e){
        console.log("Successful download of "+e.fullPath);
        renderPicture(e.fullPath);
    }, onError);

请求/响应:

07-24 08:58:12.750: D/CordovaLog(3744): {"target":"file:///mnt/sdcard/dk.test.html5Generic/","source":"http://mobilitycms.test.dk:9090/content/picture/menu/showroom","http_status":401,"code":3}

如果您需要测试路径,您需要删除 :9090,因为我在内部网络上。

任何帮助都可以消除此错误:-P

【问题讨论】:

    标签: javascript cordova


    【解决方案1】:

    问题是我忘记将我的 cordova xml 下的 url 添加为白名单:

    Android: project - res - xml - cordova.xml
    

    【讨论】:

    • 如何在cordova.xml中添加任何url?
    猜你喜欢
    • 2023-04-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-07-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多