PDA

View Full Version : EXTJS & JSP Upload file



tarotjung
13 Mar 2011, 3:54 PM
Hello, I use the UploadFile example in EXTJS (http://dev.sencha.com/deploy/dev/examples/form/file-upload.html) but I don't know what to write in the server side to save the uploaded file (in jsp) help me please

My client side code is


var fp = new Ext.FormPanel({
//renderTo: 'fi-form',
fileUpload: true,
width: 500,
frame: true,
title: 'File Upload Form',
autoHeight: true,
bodyStyle: 'padding: 10px 10px 0 10px;',
labelWidth: 50,
defaults: {
anchor: '95%',
allowBlank: false,
msgTarget: 'side'
},
items: [{
xtype: 'fileuploadfield',
id: 'form-file',
emptyText: 'Select an image',
fieldLabel: 'Photo',
name: 'photo-path',
buttonText: '',
buttonCfg: {
iconCls: 'upload-icon'
}
}],
buttons: [{
text: 'Save',
handler: function(){
if(fp.getForm().isValid()){
fp.getForm().submit({
url: file-upload.jsp',
waitMsg: 'Uploading...',
success: function(fp, o){
msg('Success', 'Processed file');
}
});
}
}
},{
text: 'Reset',
handler: function(){
fp.getForm().reset();
}
}]
});

AnjanaSathyan
23 Oct 2014, 6:00 PM
Hey, Did you get any help?even I need to call a jsp in the url config.

Please help.