我用struts 1.x做的测试,调用Ext.ux.UploadDialog的代码如下:
html页面中的调用上传控件显示部分
Ext.onReady(function(){
var dialog = new Ext.ux.UploadDialog.Dialog({
url: 'news.do?method=upload',
post_var_name:'file',
width : 450,
height : 300,
minWidth : 450,
minHeight : 300,
draggable : true ,
resizable : true ,
//autoCreate: true,
constraintoviewport: true ,
//permitted_extensions:['rar'],
modal: true ,
reset_on_hide: false,
allow_close_on_upload: false,
upload_autostart: false
});
dialog.show('show-button');
});
当选择一个文件后点击‘开始上传’按钮,此时发送请求到后台,上面属性中有一行“post_var_name:'file',”在网上查过好像说是后台接收的参数,我就用request.getParameter("file")方式尝试了打印一下结果为null,请教该怎么取上传列表中的数据到后台?