Forum /
Sencha General Forums /
Community Discussion /
Sencha User
File upload and form submit simultaneously
File upload and form submit simultaneously
When you wnat to upload any file use getForm().fileUpload= true and when want a simple submit use
getForm().fileUpload= false; and pass the params. when you do fileUpload =true you wont be able to get the params after submit.
Code:
var url="../urlServlet" ;
var condition=Ext.getCmp('radioGrp' ).getValue();
if (condition==='fileUpload')
Ext.getCmp('myuploadform' ).getForm().fileUpload= true ;
else
Ext.getCmp('myuploadform' ).getForm().fileUpload= false ;
Ext.getCmp('myuploadform' ).getForm().submit({
reset:false ,
url: url,
waitMsg:'Uploading File..' ,
timeout: 30000,
params:{filepath:path},
success: function (form, action)
{extAlert(action.result.msg);
Ext.getCmp('myuploadform' ).getForm().reset();},
failure: function (form,action)
{extAlert(action.result.msg);}
});
Sencha is used by over two million developers. Join the community, wherever you’d like that community to be
or Join Us