1

I am trying to aplly the upload file in extjs as in this example:

 myuploadform= new Ext.FormPanel({
            fileUpload: true,
            width: 500,
            autoHeight: true,
            bodyStyle: 'padding: 10px 10px 10px 10px;',
            labelWidth: 50,
            defaults: {
                anchor: '95%',
                allowBlank: false,
                msgTarget: 'side'
            },
            items:[
            {
                xtype: 'fileuploadfield',
                id: 'filedata',
                emptyText: 'Select a document to upload...',
                fieldLabel: 'File',
                buttonText: 'Browse'
            }],
            buttons: [{
                text: 'Upload',
                handler: function(){
                    if(myuploadform.getForm().isValid()){
                        form_action=1;
                        myuploadform.getForm().submit({
                            url: 'handleupload.php',
                            waitMsg: 'Uploading file...',
                            success: function(form,action){
                                msg('Success', 'Processed file on the server');
                            }
                        });
                    }
                }
            }]
        })

When i run it i see it tries to upload the file and nothing happends(it never finishes);

Now as i understand the handleupload.php should process the uploaded file.

I have tryed aplying it as in this eaxmple: file upload using EXT JS

but I cant seem to make it work, what should be exactly in the php file?

ty.

Community
  • 1
  • 1
susparsy
  • 1,016
  • 5
  • 22
  • 38

1 Answers1

0

There's an example in the SDk download of uploading a file with a PHP backend (PHP code included). Look under /examples/form/file-upload.html.

That should have everything you need.

Evan Trimboli
  • 29,900
  • 6
  • 45
  • 66