this.PANELBASICO = Ext.create('Ext.form.Panel',
{ width: 500, frame: true, title: 'File Upload Form', bodyPadding: '10 10 0',
defaults:
{ anchor: '100%',
allowBlank: false,
msgTarget: 'side',
labelWidth: 50 },
items: [{
xtype: 'textfield',
fieldLabel: 'Name'
},
{ xtype: 'filefield',
id: 'form-file',
emptyText: 'Select an image',
fieldLabel: 'Photo',
name: 'photo-path',
buttonText: '',
buttonConfig:
{ iconCls: 'upload-icon' }
}], buttons:
[{ text: 'Save', handler: function()
{ var form = this.up('form').getForm();
if(form.isValid()){ form.submit(
{ url: '/NombreServlet', waitMsg: 'Uploading your photo...', success: function(fp, o)
{ msg('Success', 'Processed file "' + o.result.file + '" on the server'); } }); } } },
{ text: 'Reset', handler: function()
{ this.up('form').getForm().reset(); } }]
});
SERVIDOR(SERVLET)
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException
{
//RECUPERAMOS LOS FICHEROS
List
No hay comentarios:
Publicar un comentario