|
1、我在浏览器里面访问 http://192.168.1.133:8085/baas/lj/upImg/uploadFile ,在控制台里面是有反应的 图1
2、但是在app中通过cordova-plugin-file-transfer插件 执行下面js,却始终无法进入在baas里面的Servlet, APP打包的时候,插件确认封装进去了,问题困扰了很久已经没找到问题?
Model.prototype.uploadFile = function(file) {
var options = new FileUploadOptions();
options.fileKey = "fileAddPic";
options.fileName = "x5Test";
options.mimeType = "video/mp4";
var uri = encodeURI(location.origin + "/baas/lj/upImg/uploadFile");
options.chunkedMode = false;
var params = new Object();
params.id = "1";
params.name = "test";
options.params = params;
var ft = new FileTransfer();
ft.upload(file, uri, success, fail, options);
function success(result) {
alert("成功");
}
function fail(message) {
alert("失败");
}
};
|
|