Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ResponseHtml empty on Failure on Internet Explorer 11 #170

Open
whitedevils opened this issue Jul 2, 2020 · 0 comments
Open

ResponseHtml empty on Failure on Internet Explorer 11 #170

whitedevils opened this issue Jul 2, 2020 · 0 comments

Comments

@whitedevils
Copy link

This is my code in my MVC C# project. ResponseHtml is always empty on IE11 browser

            try
            {
                    var disposition = new System.Net.Mime.ContentDisposition
                    {
                        FileName = "Test",
                        Inline = false,
                        DispositionType = System.Net.Mime.DispositionTypeNames.Attachment
                    };
                    Response.Headers.Add("Content-Disposition", disposition.ToString());
                    return File(fileContent, "application/pdf");
            }
            catch (Exception ex)
            {
                Response.StatusCode = 500;
                return Content(ex.Message, "text/html");
            }

and this is the javascript

         $.fileDownload($(this).attr('action'), {
                    httpMethod: 'POST',
                    data: $(this).serialize(),
                    failCallback: function (responseHtml, url, error) {
                        debugger                       
                    },
                    successCallback: function (data) {
                        document.cookie = "fileDownload=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
                    }
                });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant