The browser is probably expecting either a JSON or an XML response, but is instead getting a blob of binary data. You cannot, to my knowledge, download a file with an AJAX request, instead you need to cause the browser to navigate to a URL that will download a file.
This can be accomplished with something like a generic handler (If in asp.net webforms), or an action method that returns a file (if MVC). You can navigate from Javascript with window.location
, or create a <a>
tag with the href
set to wherever downloads the file, pass whatever parameters you need as a query string, and then the browser will work as expected.