我使用phonegap文件传输API来传输文件。所有文本文件都正常上传。但图像无法上传。首先它告诉'uploaded 115456 of 1177052 bytes'
然后它失败了。它给出超时错误,说错误代码3和http状态为空
var win = function() {
}
var fail = function() {
}
var options = new FileUploadOptions();
options.headers = {Connection : "close"}
options.fileKey = "uploadFile";
options.fileName = oneEntry.baseName;
var mimeType;
if (oneEntry.gips.i) {
mimeType = "image/jpg";
} else {
mimeType = "text/plain";
}
options.mimeType = mimeType;
options.chunkedMode = false;
var params = new Object();
params.action = "uploadFile";
options.params = params;
var ft = new FileTransfer();
ft.upload(oneEntry.fE.fullPath, "http://myserverpath", win, fail, options,true);
编辑:作为一些链接,这个文件上传是更高版本的cordova中的一个问题。但它适用于较低版本,如cordova 1.9.0。真的吗??如果是这样,我必须返回并将我的cordova从2.5.0版本更改为1.9.0版本