Phonegap的FileTransfer.upload()在Android上引发错误代码3 [英] Phonegap's FileTransfer.upload() throwing error code 3 on Android

查看:58
本文介绍了Phonegap的FileTransfer.upload()在Android上引发错误代码3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将图片上传到服务器.我能够使用iOS成功上传图像,但是当我在android上尝试时,出现错误代码3.当前使用phonegap cordova 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.

我已经尝试过在参数中添加true

I already tried adding true to the parameters

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

并添加

options.chunkedMode = false;

我的AndroidManifest文件包含:

My AndroidManifest file contains:

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

我的cordova.xml文件包含:

My cordova.xml file contains:

<access origin="*"/>

我想念什么吗?

谢谢

推荐答案

问题可能不在Phonegap中.如果服务器是基于Windows的服务器,请尝试使用其他服务器.另外,不要忘记添加以下行:

The issue probably is not in Phonegap. if the server is a Windows based server, try using another server. Also, don´t forget to add these lines:

var options = new FileUploadOptions();
options.chunkedMode = false;
options.headers = {
      Connection: "close"
   };

这篇关于Phonegap的FileTransfer.upload()在Android上引发错误代码3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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