May 05, 2014 by Anuraj
.Net ASP.Net ASP.Net MVC
While working with the ASP.Net MVC project, one of my QA team member reported a strange issue, while uploading a file, Internet Explorer 9, showing a download file dialog like this.
And the controller action is similar like this.
This code is working fine in other browsers like Chrome, Firefox, and later versions of Internet Explorer(I tried with IE 11).
Later I found the solution, it was due to content type handling problem with Internet Explorer. You can resolve it by using the other overloads available for JsonResult class, in which you can specify the content type. And here is the modified version of the action method.
Happy Programming :)
Copyright © 2024 Anuraj. Blog content licensed under the Creative Commons CC BY 2.5 | Unless otherwise stated or granted, code samples licensed under the MIT license. This is a personal blog. The opinions expressed here represent my own and not those of my employer. Powered by Jekyll. Hosted with ❤ by GitHub