【问题标题】:Cordova FileTransfer.upload() fails on iOSCordova FileTransfer.upload() 在 iOS 上失败
【发布时间】:2018-12-10 06:30:41
【问题描述】:

我正在尝试将FileTransfer.upload() 发送到我们的测试服务器,该服务器具有使用 Cordova 1.8.1 的自签名证书

以下代码在 Android 上运行良好,但在 iOS 上不运行。

var debug = true;
var uploadurl = "https://my.host.com/upload/file/here";
ft.upload(nImageURI, uploadurl, win2, fail, options, debug);

上传方法中的debug=trueundocumented debug feature

我仅在 iOS 上收到以下错误。 Android 运行良好。

FileTransferError {
code = 3;
"http_status" = 0;
source = "https://my.host.com/upload/file/here";
target = "file:///var/mobile/Applications/1124016F-4FEE-400E-9AF1-2E2195EED1AF/myApp.app/www/index.html";
}
File Transfer Error: The certificate for this server is invalid. You might be connecting to a server that is pretending to be ‚Äúhttps://my.host.com/upload/file/hereÄù which could put your confidential information 

【问题讨论】:

    标签: cordova https upload file-transfer


    【解决方案1】:

    也许您需要将白名单添加到 phonegap.plist (cordova.plist)。按照this link 的说明进行操作。

    【讨论】:

    • @all 编辑者,这是我第一次尝试回答 Stackoverflow.com 中的问题,感谢您使答案更加人性化。
    猜你喜欢
    • 2012-01-21
    • 2014-12-15
    • 2019-11-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-06-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多