Results 1 to 2 of 2

Thread: File upload and form submit simultaneously

  1. #1
    Sencha User abhijit roy's Avatar
    Join Date
    Nov 2011
    Location
    Mumbai,India
    Posts
    11
    Vote Rating
    0
      0  

    Default 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);}
    });




  2. #2
    Sencha User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,062
    Vote Rating
    1391
      0  

    Default

    Ext JS 3 or 4?
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •