I have something like this in my View:
var url = \'@Url.Action(\"DownloadZip\", \"Program\")\' + \'?programNums=\' + selectedRow;
$.ajax({
Have you considered passing back JSON with a file Url?
If the file is successfully found/created. Send back a JSON result with the link to the file. Then in javascript use windows.location
to retrieve the file. When there is an error, the JSON result will contain the error information and this info can be displayed to the user. For this to work, you'll need to create another endpoint (action) that can stream the file.