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.

4

1 回答 1

0

在 SDK 下载中有一个使用 PHP 后端(包括 PHP 代码)上传文件的示例。查看 /examples/form/file-upload.html。

那应该有你需要的一切。

于 2013-10-23T09:56:56.217 回答