PhoneGap的:FileTransfer.upload()失败,Android上 [英] Phonegap : FileTransfer.upload() fails on Android

查看:255
本文介绍了PhoneGap的:FileTransfer.upload()失败,Android上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我正在尝试将图片上传到与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);

感谢您!

这篇关于PhoneGap的:FileTransfer.upload()失败,Android上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆