wx.uploadFile 中formData提交的数据,在java后台如何获取
图片上传,需要使用formData 传递部分参数,服务器后台是Jfinal ,但是,我发现似乎取不到前面传递过来的参数,这是为何?到底要怎么取呢?
wx.uploadFile({
url: app.globalData._server +‘erp/wxa/wordRecord/upload’, //仅为示例,非真实的接口地址
filePath: filepath,
name: ‘file’,
formData: { ‘upload_folder’: upload_folder },
success:function(res){
},
fail:function(res){
}
//服务端
[@ActionKey](/user/ActionKey)("/upload")
@Before(WxaReqInterceptor.class)public void upload() {
String uploadFolder=getRequest().getParameter('upload_folder');
//uploadFolder .....取不到数据
}