jquery.fileDownload
jquery.fileDownload copied to clipboard
ResponseHtml empty on Failure on Internet Explorer 11
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=/;";
}
});