ASP.NET MVC and AjaxFileUpload
Okay, this is driving me crazy. I've tried to figure this out forever. I want to do an asynchronous upload using ajaxFileUpload . I have a message that the file for my controller is just fine, however, when I try to return a JsonResult from it, I get a Save File As dialog. I've tried everything to get around this and I either get an error or the Save As dialog. I'm guessing it has something to do with the type of content that is sent when the file is uploaded. I would really appreciate it if anyone could help. Thanks in advance!
If you look at the code there, it actually creates a new form and iframe, and then POSTing the form to the iframe. The response is returned to the iframe, which is then received and returned by code. My guess is that if you downloaded the JsonResult right in the browser, this will also trigger the download popup. Check the headers returned by the JsonResult to understand why, when loaded as a page, it thinks it is loading. Maybe you need to set Content-Type to text / plain or remove Content-Disposition header.
a source to share