Results 1 to 6 of 6

Thread: Form upload does not work on remote client

  1. #1

    Exclamation Form upload does not work on remote client

    I use a regular Ext.form.Form to upload one file.
    It works fine on local, but when I try to upload from other one's box, server side can't recieve the request.
    Code:
    var file_update = new Ext.form.Field({
            fieldLabel: 'picture',
            inputType: 'file',
            name: 'file_update',
            id: 'file_update',
            width: 330,
            allowBlank: false
        }); 
        var form_upload_update = new Ext.form.Form({
            labelAlign: 'right',
            url:'http://localhost:8084/digiCRMWebWork/upload',
            fileUpload: true
        });
    
        form_upload_update.column({width: 600, labelWidth:120, style:'margin-left:8px;margin-top:8px'});
        form_upload_update.fieldset(
            {id:'eventPic_upload',legend:'lblEvent_Picture'},
            file_update
        );
        form_upload_update.applyIfToFields({width:500});
        form_upload_update.render('upload-update');
        
        var eventPic_upload = Ext.get('eventPic_upload');
        var bt_upload = eventPic_upload.createChild({
            tag: 'center'
        });
        var pic_show_update = Ext.get('pic_show_update');
        new Ext.Button(bt_upload,{
            text: 'upload',
            handler: function(){
                form_upload_update.submit({
                    waitMsg:'uploading...',
                    reset: false,
                    failure: function(form_upload_update, action) {
                        Ext.MessageBox.alert("fail");
                    },
                    success: function(form_upload_update, action) {
                        Ext.MessageBox.alert("success");
                    }
                });
            }
        });
        form_upload_update.end();
    I tried a normal html form it works, so it's not the server or network issue, is this a bug of Ext?

  2. #2
    Sencha User
    Join Date
    Mar 2007
    Posts
    31

    Default

    For uploading file forms, I would recommend Fiddler to see the what you are sending, the headers, and the response.

  3. #3

    Default Seems Ext not submit the form

    Seems Ext not submit the form

  4. #4

    Default

    you are trying to submit the form to a different host than the form/javascript was loaded from?

  5. #5

    Default

    No I just want to upload to the host which my browser got scripts from.
    Like A box is the host, B box is my client. Above code works if i use A as client upload to A. But doesn't work if I use B as client.

  6. #6

    Default

    this:
    Code:
    url:'http://localhost:8084/digiCRMWebWork/upload',
    specifies to always look to the local machine for the handler, regardless of where the script was loaded from. handlers should be specified as relative url's when possible to avoid this problem when switching hosts.

Posting Permissions

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