Results 1 to 2 of 2

Thread: Filefield issue with IE11

  1. #1

    Default Filefield issue with IE11

    HI,
    AM using filefield in extjs 5.
    In this am submitting the form (form.submit()) to upload the file.
    In this while getting the response, in Success:true case in IE11 it is showing Success:false and excutes the failure case only.
    And in IE11 in case of success IE11 downloading some Json file.
    In Success:true case handling the code like
    below is my code.

    Code:
    uploadedFileSubmit:function(){
            var uploadedFile    =    Ext.ComponentQuery.query('#btnFileUploadCreateTicket')[0];
            var fileName        =    uploadedFile.getValue();
            var gasDTO = {
                fileName: '',
                fileSystem: 'PU',
                genericKey: 'PDF_UPLOADS',
                tempInd: 'N'
            };
            var formAttachment     =      Ext.ComponentQuery.query('#containerattachments')[0];
            formAttachment.submit({
                method : 'POST',  
                url:'/vec/doc/billing/gas/saveMultiPartFormFile',
                headers : {'Content-Type':'multipart/form-data'},
                params: {
                    input: Ext.JSON.encodeValue(gasDTO)
                },
                waitMsg: 'Uploading your file',
                waitTitle: 'Please Wait...',
                success: function(form, action) {
                    var result = action.result;
                    if(result.success){
                        if(result.data.status == 'scan-failed'){
                            Ext.MessageBox.show({
                                title: 'Error',
                                msg: 'The attachment cannot be added, we have identified a virus in the attachment.',
                                buttons: Ext.MessageBox.OK,
                                icon: Ext.MessageBox.ERROR
                            });
                            formAttachment.reset();
                            return;
                        }
                        var win = Ext.WindowManager.getActive();
                        if (win) {
                            win.close();
                            Ext.MessageBox.show({
                                title: 'Success',
                                msg: 'Successfully file uploaded.',
                                buttons: Ext.MessageBox.OK,
                                icon: Ext.MessageBox.SUCCESS,
                                fn: function(btn) {
                                    if (btn === 'ok') {
                                        Ext.ComponentQuery.query('#custmPdfRfrshBtnItemId')[0].fireEvent('click');
                                    }
                                }
                            });
                        }
                    }
                },
                failure: function(form, action) {
                    if(Ext.isIE){
                        if((!action.result.success) && (action.result.errors.length == 0)){
                            var win = Ext.WindowManager.getActive();
                            if (win) {
                                win.close();
                                Ext.MessageBox.show({
                                    title: 'Success',
                                    msg: 'Successfully file uploaded.',
                                    buttons: Ext.MessageBox.OK,
                                    icon: Ext.MessageBox.SUCCESS,
                                    fn: function(btn) {
                                        if (btn === 'ok') {
                                            Ext.ComponentQuery.query('#custmPdfRfrshBtnItemId')[0].fireEvent('click');
                                        }
                                    }
                                });
                            }
                        }else {
                            Ext.MessageBox.show({
                                title: 'Error',
                                msg: fileName + '-->  ' + 'An error occurred while processing your request. Please try again later.',
                                buttons: Ext.MessageBox.OK,
                                icon: Ext.MessageBox.ERROR
                            });
                            formAttachment.reset();
                            return;
                        }
                    }else {
                        Ext.MessageBox.close();
                        Ext.MessageBox.show({
                            title: 'Error',
                            msg: fileName + '-->  ' + 'An error occurred while processing your request. Please try again later.',
                            buttons: Ext.MessageBox.OK,
                            icon: Ext.MessageBox.ERROR
                        });
                        formAttachment.reset();
                        return;
                    }
                }
            });
            
        }
    I need the help in two cases.
    1). Why is it giving the Success:false in case of Success:true.
    2). Why Json file is downloadng in IE11.


    Please help me in this.

    Thanks in Advance
    Kamalakar Reddy V

  2. #2

    Default

    I got the solution for this.
    I used below code to resolve the issue.
    Instead of form.submit() am using the ajax call.

    var file = s.fileInputEl.dom.files[0],
    data = new FormData();
    data.append('file', file);
    Ext.Ajax.request({
    url: '/upload/files',
    rawData: data,
    headers: {'Content-Type':null}, //to use content type of FormData
    success: function(response){
    }
    });Thanks
    Kamalakr Reddy V

Similar Threads

  1. Filefield issue with IE11
    By kamalakarreddy vancha in forum Ext 5: Q&A
    Replies: 0
    Last Post: 20 Feb 2018, 5:27 AM
  2. Replies: 1
    Last Post: 9 Jun 2015, 7:28 AM
  3. Replies: 3
    Last Post: 29 May 2015, 3:50 AM
  4. IE11
    By JLangdon in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 3 Jul 2013, 2:14 PM

Tags for this Thread

Posting Permissions

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