|

楼主 |
发表于 2017-1-5 13:02:29
|
显示全部楼层
对的,我用了baasServer 写的,也看了SimpleFileStore.java ,但是从request里面获取不到参数,还是要从params.getString(key)才能获取到,这是为什么呢,前端js:
//拍照
Model.prototype.cameraBtnClick = function(event) {
var operateLabel = this.getElementByXid("operateLabel");
var resultLabel = this.getElementByXid("resultLabel");
$(operateLabel).text("开始拍照!");
$(resultLabel).text("");
var data = this.comp("fileData");
function onSuccess(imageURI) {
data.newData({index : 0});
data.setValue("filePath", imageURI);
data.setValue("fileName", imageURI.substr(imageURI.lastIndexOf('/') + 1));
data.setValue('createTime', justep.Date.toString(new Date(), justep.Date.DEFAULT_FORMAT ));
$(resultLabel).text("成功1"+imageURI);
//debugger
justep.Baas.sendRequest({
"url" : "/test/serach_action",
"action" : "uploadfile",
"async" : false,
"params" : {
"imagepath":imageURI,
"storeFileName":imageURI.substr(imageURI.lastIndexOf('/') + 1),
"ownerID":111
},
"success" : function(data) {
alert("11")
}
});
}
function onFail(message) {
$(resultLabel).text("失败:"+message);
}
navigator.camera.getPicture(onSuccess, onFail, {quality : 100});
};
没有压缩过。 |
|