Cordova FileTransfer.upload()在iOS上失败

时间:2012-08-17 19:04:54

标签: cordova https upload file-transfer

我正在尝试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 

1 个答案:

答案 0 :(得分:4)

也许您需要将白名单添加到phonegap.plist(cordova.plist)。按照this link

中的说明操作