1. #1
    Ext User
    Join Date
    Jul 2009
    Posts
    82
    Vote Rating
    0
    andryi is on a distinguished road

      0  

    Default problem with upload a file

    problem with upload a file


    Hi all, I've got a problem, with the enctype, well, I supposed:

    here is my code
    Code:
        var top2 = new Ext.FormPanel({
            fileUpload: true,
            width: 500,
            frame: true,
            title: 'File Upload Form',
            autoHeight: true,
            bodyStyle: 'padding: 10px 10px 0 10px;',
            labelWidth: 50,
            defaults: {
                anchor: '95%',
                allowBlank: false,
                msgTarget: 'side'
            },
            items: [{
                xtype: 'textfield',
                fieldLabel: 'Name'
            },{
                xtype: 'fileuploadfield',
                id: 'form-file',
                emptyText: 'Select an image',
                fieldLabel: 'Photo',
                name: 'photo-path',
                buttonText: '',
                buttonCfg: {
                    iconCls: 'upload-icon'
                }
            }],
            buttons: [{
                text: 'Save',
                handler: function(){
                    if(top2.getForm().isValid()){
                        top2.getForm().submit({
                            url:'JSP/upload.jsp',
                            method: 'POST',
                            enctype: 'multipart/form-data',
                            waitMsg: 'Uploading your video...',
                            success: function(top2, o){
                                alert("you did it");
                            },
                            failure: function(top2,o){
                                msg('Error','wrong);
                            }
                        });
                    }
                }
            },{
                text: 'Reset',
                handler: function(){
                    top2.getForm().reset();
                }
            }]
        });
    
        top2.render(document.body);
    So when I run the app, the alert appear, but when I check my disk, nothing happened, not save the file

  2. #2
    Sencha User
    Join Date
    Apr 2008
    Location
    Hong Kong
    Posts
    171
    Vote Rating
    0
    jarlau is on a distinguished road

      0  

  3. #3
    Ext User
    Join Date
    Jul 2009
    Posts
    82
    Vote Rating
    0
    andryi is on a distinguished road

      0  

    Default


    well I changed a little my code, but still not works

    Code:
    buttons: [{
                text: 'Save',
                handler: function(){
                    if(top2.getForm().isValid()){
                        top2.getForm().submit({
                            autoCreate: {
                                tag: 'form',
                                action: 'JSP/upload2.jsp',
                                method: 'POST',
                                enctype: 'multipart/form-data',
                                name: 'upload-form'
                            }
                        })
                     }
                }
     }]

  4. #4
    Sencha User
    Join Date
    Apr 2008
    Location
    Hong Kong
    Posts
    171
    Vote Rating
    0
    jarlau is on a distinguished road

      0  

    Default


    try
    Code:
                        top2.getForm().submit({
                            url:'JSP/upload.jsp',
                            method: 'POST',
                            fileUpload: true,
                            waitMsg: 'Uploading your video...',
                            success: function(top2, o){
                                alert("you did it");
                            },
                            failure: function(top2,o){
                                msg('Error','wrong);
                            }
                        });

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar