XG.WF.UpLoadXML=function(){
//利用表单提交文件上传
var form=new Ext.form.FormPanel({enctype:'multipart/form-data',//多部分表单数据
fileUpload:true,//是否上传文件
frame:true,
labelWidth:80,
defaults:{width:150},
defaultType:'textfield',
items:[{
allowBlank:false,
blankText:"所选文件为空,请确认",
fieldLabel:"流程文件",
name:'uploadFile',
height:18,
anchor:'90%',
inputType:'file'
}],
buttons:[{
text:'保存',
handler:function(){
}
},{
text:'取消',
handler:function(){
filewin.close();
}
}]
});
filewin=new Ext.Window({
title:'导入流程',
autoShow:true,
closable:true,//是否可以关闭
closeAction:'hide',
constrain:true,//是否约束窗口只能在容器内移动
draggable:false,//是否可以拖拽
width:500,
height:100,
plain:true,
resizable:false,
items:[form]
}).show(this);
}
后台获取文件:
HttpPostedFile postedFileOfUsers = syncContext.Request.Files["uploadFile"];