var form = new Ext.form.FormPanel
({
layout:'form',
labelWidth:60,
labelAlign:'right',
fileUpload:true,/
items:
[{
id:'file',
xtype:'textfield',
fileUpload:true,
fieldLabel:'项目资料',
labelStyle:'margin:0 0 10px 0;',
name: 'uploadFile',
inputType: 'file',
blankText: '请上传文件',
width:170,
}]
title:'项目申报',
layout:'form',
autoHeight:true,
width:350,
frame:true,
//closeAction:'hide',
labelWidth:60,
modal:true,
labelAlign:'right',
items:[form],
buttons:
[{
text:'申报',
handler:function()
{
}
},
{
text:'取消',
handler:function()
{
addProgram.close();
}
}],
buttonAlign:'center'
({
layout:'form',
labelWidth:60,
labelAlign:'right',
fileUpload:true,/
items:
[{
id:'file',
xtype:'textfield',
fileUpload:true,
fieldLabel:'项目资料',
labelStyle:'margin:0 0 10px 0;',
name: 'uploadFile',
inputType: 'file',
blankText: '请上传文件',
width:170,
}]
});
//新增项目
var addProgram = new Ext.Window
title:'项目申报',
layout:'form',
autoHeight:true,
width:350,
frame:true,
//closeAction:'hide',
labelWidth:60,
modal:true,
labelAlign:'right',
items:[form],
buttons:
[{
text:'申报',
handler:function()
{
form.getForm().submit
({
url:pm_papplication_add,});
method:'POST',
success:function(resp,obt)
{
Ext.MessageBox.alert("提示信息","申报成功!");
},
failure : function(form, action)
{
Ext.MessageBox.alert("提示信息","申报失败!");
}
}
},
{
text:'取消',
handler:function()
{
addProgram.close();
}
}],
buttonAlign:'center'
}).show();
//获取上传文件
public void add(HttpSession session,HttpServletRequest request,HttpServletResponse response,
@RequestParam(value="uploadFile")MultipartFile multipartFile)
{
//存取路径
String path = session.getServletContext().getRealPath("upload/resource/");
//通过MultipartFile存取到服务器中
multipartFile.transferTo(new File(path,multipartFile.getOriginalFilename()));
}