[CLOSED] IE11 Fileupload & DirectEvent

  1. #1

    [CLOSED] IE11 Fileupload & DirectEvent

    Hi,

    Combining a form file upload with a directevent does not work in IE11 (firefox and chrome doesn't have this issue) as the response opens a save json file download box. The EXTJS documentation (http://docs.sencha.com/extjs/5.0/5.0...thod-hasUpload) describes that the reponse should be a text/plain contenttype.

    The contenttype is set to application/json in the directresult method WriteContent.

    How can I fix the fileupload issue?

    Thanks,

    Sander
    Last edited by fabricio.murta; Jun 10, 2016 at 6:06 PM.
  2. #2
    Hello @thesvr!

    Can you provide us with a simplified test case reproducing the issue so we can advice you about how to deal with the problem?
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Controller
        public class TestController : Controller
        {
            // GET: Test
            public ActionResult Index()
            {
                return View();
            }
    
    
            public ActionResult TestAction()
            {
                X.Msg.Alert("Error", "Test").Show();
                return this.Direct();
            }
        }
    View
    @(
     Html.X().FormPanel()
         .Region(Region.Center)
                .Items(AddForm =>
                {
                    AddForm.Add(
        Html.X().FileUploadField()
        .ItemID("file")
        .Name("file")
        .Width(500)
        .FieldLabel("Select file")
        .LabelAlign(LabelAlign.Top)
        );
                }
    )
    
    .Buttons(AddButtons =>
                {
                    AddButtons.Add(
                        Html.X().Button()
                        .Text("Start")  
                        .FormBind(true)
                        .DirectEvents(directEvents =>
                        {
                            directEvents.Click.Url = Url.Action("TestAction");
                            directEvents.Click.FormID = "form1";
                            directEvents.Click.Method = HttpMethod.POST;
                            directEvents.Click.Timeout = 6000000;
                            directEvents.Click.IsUpload = true;
                        }
                        )
                    );
                }
                )
                    
    )
    Message box shows in Chrome, in IE11 i get a window to download a JSON file.
  4. #4

    Resolved

    I found the solution.

    Instead of

     return this.Direct();
    I should set IsUpload parameter using:

                DirectResult result = new DirectResult();
                result.IsUpload = true;
                return result;
  5. #5
    Alright @thesvr! Glad you could figure it out and thanks for sharing the outcome!

    This 'isUpload' bit is really somewhat confusing but not something can be (at least feasibly) helped, unfortunately.
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. [CLOSED] Ext undefined in IE11
    By CPA1158139 in forum 3.x Legacy Premium Help
    Replies: 6
    Last Post: Jan 23, 2015, 4:50 PM
  2. [CLOSED] IE11 tooltips
    By bogc in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 22, 2014, 1:14 PM
  3. DirectEvent on mvc behave abnormal on IE11
    By qdano in forum 2.x Help
    Replies: 0
    Last Post: Sep 18, 2014, 7:34 AM
  4. [CLOSED] [#477] HtmlEditor icw IE11
    By prost in forum 2.x Legacy Premium Help
    Replies: 7
    Last Post: May 05, 2014, 5:27 AM
  5. [CLOSED] Need to create DirectEVent for dynamically added fileupload
    By wisdomchuck in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: May 21, 2012, 3:12 PM

Tags for this Thread

Posting Permissions