1. #1
    Sencha Premium Member Carlos.D's Avatar
    Join Date
    Nov 2011
    Location
    Luxembourg
    Posts
    38
    Vote Rating
    0
    Carlos.D is on a distinguished road

      0  

    Default Unanswered: filefield Upload localhost domain

    Unanswered: filefield Upload localhost domain


    Hi,
    I get an Javascript error : "
    Unsafe JavaScript attempt to access frame with URL data:text/html,chromewebdata from frame with URL
    http://localhost/myprojet/
    . Domains, protocols and ports must match."

    The error come form :
    ext-all-debug.js:37725
    Code:
      doc = frame.contentWindow.document || frame.contentDocument || window.frames[frame.id].document;

    When a try to use the sample upload file from ext 4.1.1 :

    Code:
    launch :function(){
        Ext.create('Ext.form.Panel', {
        title: 'Upload a Photo',
        width: 400,
        bodyPadding: 10,
        frame: true,
        renderTo: Ext.getBody(),
        items: [{
            xtype: 'filefield',
            name: 'file',
            fieldLabel: 'photo',
            labelWidth: 50,
            msgTarget: 'side',
            allowBlank: false,
            anchor: '100%',
            buttonText: 'Select Photo...'
        }],
    
    
        buttons: [{
            text: 'Upload',
            handler: function() {
                var form = this.up('form').getForm();
                if(form.isValid()){
                    form.submit({
                        url: './database/customRequest.php?ACTION=UPLOADFILE',
                        waitMsg: 'Uploading your photo...',
                        success: function(fp, o) {
                            Ext.Msg.alert('Success', 'Your photo "' + o.result.file + '" has been uploaded.');
                        }
                    });
                }
            }
        }]
    });
        
        
        }
    Any ideas, how can solve this ?

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,599
    Vote Rating
    434
    Answers
    3102
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    Do you have your app within an iframe?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha Premium Member Carlos.D's Avatar
    Join Date
    Nov 2011
    Location
    Luxembourg
    Posts
    38
    Vote Rating
    0
    Carlos.D is on a distinguished road

      0  

    Default


    No I juste run the sample from the documentation.