I've looked at many resources and the following should work, however my save as dialog box is never showing (not browser specific):
Response.ContentType = "application/octet-stream";
string downloadName = "Request "+request.RequestID+ "_researchExport.doc";
Response.AddHeader("Content-Length",
new System.IO.FileInfo(FileName).Length.ToString());
Response.AddHeader("Content-Disposition",
string.Format("attachment; filename={0};", downloadName));
Response.WriteFile(FileName);
Response.Flush();
Response.End();
The file definitely exists. I've also tried the following:
Using
Response.TransmitFile(FileName)
insteadLeaving out
Response.End()
Leaving out the
Content-Length
headerUsing
this.ControllerContext.HttpContext.Response
Any help would be greatly appreciated