PhoneGap的:FileTransfer.upload()失败,Android上FileTransfer、PhoneGap、Android、upload

由网友((厮守伱一辈子))分享简介:目前,我正在尝试将图片上传到与PhoneGap的的FileTransfer.upload()方法的服务器。它工作正常在iPhone模拟器通过WiFi,但未能在Android手机上通过3G或无线网络。 I'm currently trying to upload a picture to a server with t...

目前,我正在尝试将图片上传到与PhoneGap的的FileTransfer.upload()方法的服务器。它工作正常在iPhone模拟器通过WiFi,但未能在Android手机上通过3G或无线网络。

I'm currently trying to upload a picture to a server with the FileTransfer.upload() method of PhoneGap. It works fine on the iPhone Simulator over Wifi, but fails on an Android phone over 3G or Wifi.

警报(错误。code)返回'3',但我不能找出这个错误code为。

alert(error.code) returns '3' but I couldnt find out what this error code is.

有没有人偶然发现了同样的问题,并设法解决它? 请大家帮帮忙。

Did anybody stumbled upon the same problem and managed to solve it ? Please help.

推荐答案

今天,我想西蒙·麦克唐纳的答案,它的工作,所以对于那些谁有同样的问题。它的证书相关的,并且可以通过在上传()函数,如下面的末尾添加一个'真正的'参数根本解决:

Today, I tried Simon MacDonald's answer and it worked, so for those who have the same problem. It's certificate related and can be solved simply by adding a 'true' parameter at the end of the upload() function like below :

upload(filePath, server, successCallback, errorCallback, options, true);

感谢您!

阅读全文

相关推荐

最新文章