Results 1 to 3 of 3

Thread: File field not working in Extjs 4.1 ?

  1. #1
    Sencha User
    Join Date
    Mar 2012
    Location
    Ludhiana, Punjab, India
    Posts
    12
    Vote Rating
    0
      0  

    Default Unanswered: File field not working in Extjs 4.1 ?

    Hi,

    I have one form with filefiled xtype. But its could not working. Its have so many problems,

    When i submit form is not post correct form file field data.

    Code:
    Ext.define('Saas.view.Masters.Companies.Form.CompaniesForm', {extend : 'Ext.form.Panel',
        alias : 'widget.CompaniesForm',
        id : 'CompaniesAddForm',
        method : 'POST',
        enctype:'multipart/form-data',
        fileUpload: true,
        isUpload: true,
    
    
        initComponent: function (arguments) {
            var me = this;
            Ext.apply(me, {
            autoHeight : true,
            width : 920,
            bodyPadding : 5,
            items: [{
                xtype: 'filefield',
                name: 'logo_name',
                fieldLabel: 'Photo',
                labelWidth: 50,
                msgTarget: 'side',
                allowBlank: false,
                anchor: '100%',
                buttonText: 'Select Photo...',
                listeners : {
                    change: function(btn, name, eOpts) {
                    Ext.getCmp('companyLogo').setSrc(this.getValue()) ;
                }
            }
        },{
            xtype : 'button',
            text: 'Upload',
            handler: function() {
                var form = this.up('form').getForm();
                if(form.isValid()){
                form.submit({
                url: 'photo-upload.php',
                waitMsg: 'Uploading your photo...',
                success: function(fp, o) {
                Ext.Msg.alert('Success', 'Your photo "' + o.result.file + '" has been uploaded.');
                }
            });
        }
        }    
    }]
    });
    me.callParent(arguments);
    }
    });
    Thanks,

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,389
    Answers
    716
    Vote Rating
    498
      0  

    Default

    What is sent in your header?
    Do you get a response from the server? Can you provide this please.

    We will need a bit more info to help.

    Scott.

  3. #3
    Sencha User
    Join Date
    Mar 2012
    Location
    Ludhiana, Punjab, India
    Posts
    12
    Vote Rating
    0
      0  

    Default

    Hi Scottmartan,

    When i post form then, show data with post request in firebug.


    Code:
    logo_name :?JFIF??`?`???Adobe?d????]Exif??MM?*????2???????b;???????vGF???????GI?????????????????????????i???????}???2009:03:12 13:46:42?Corbis??????????????????????54????????54?????????????2008:03:14 13:59:26?2008:03:14 13:59:26???????????????)??????1??????9?????????????H??????H????JFIF???????C?(1#%(:3=<9387@H\N@DWE78PmQW_bghg>Mqypdx\egc?C//cB8Bcccccccccccccccccccccccccccccccccccccccccccccccccc??x? "????????????	????}?!1AQa"q2?#BR$3br?	%&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz?????????????????????????	???w?!1AQaq"2B?	#3Rbr$4%&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz???????????????????????K|`?*[mǦx*)=r|<).fY~b=qxvU˥?s/#?j̼kH1??n^1q\s`]B??<?E""7D:?ǨV.IdSj۴w2lܩ=Hu q~,pWm.Jx??nh??F;?ocW??R&???vz?Ȭ,bf'~5nk[L?Dm=,7?7TWrk&N7)S%ͲI#S0ۯU??c(rQIbQ... 
    etc...
    I am using codeigniter Framwork in backend

    Thanks,

Tags for this Thread

Posting Permissions

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