PhoneGap的的FileTransfer.upload()抛出错误code 3安卓 [英] Phonegap's FileTransfer.upload() throwing error code 3 on Android

查看:502
本文介绍了PhoneGap的的FileTransfer.upload()抛出错误code 3安卓的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在上传图片到服务器。我能够使用的是iOS成功上传一张图片,但是当我尝试在Android上我得到的错误code 3.目前使用PhoneGap的科尔多瓦1.8.1。

I am working on uploading a picture to a server. I am able to successfully upload an image using iOS but when i try on android I get the error code 3. Currently using phonegap cordova 1.8.1.

我已经尝试添加真正的参数

I already tried adding true to the parameters

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

和添加此

options.chunkedMode = false;

我的Andr​​oidManifest文件包括:

My AndroidManifest file contains:

<uses-permission android:name="android.permission.INTERNET" />

我的cordova.xml文件包括:

My cordova.xml file contains:

<access origin="*"/>

我缺少的东西?

Am I missing something?

感谢

推荐答案

增加code:

var op;
op = new FileUploadOptions();

op.headers = {
    Connection: "close"
};

添加此之后 - code开始,没有任何错误工作。 有一点更详细的描述:的http://grandiz.com/phonegap-development/phonegap-file-transfer-error-$c$c-3-solved 希望帮助!

After adding this - code started to work well with no errors. A bit more detailed description: http://grandiz.com/phonegap-development/phonegap-file-transfer-error-code-3-solved Hope that helps!

这篇关于PhoneGap的的FileTransfer.upload()抛出错误code 3安卓的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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