public FileResult Download(int id) { byte[] fileBytes = System.IO.File.ReadAllBytes(Server.MapPath("~/Reports/Invoices/" + Table.Where(x => x.ID == id).FirstOrDefault().ID + ".pdf")); string fileName = Table.Where(x => x.ID == id).FirstOrDefault().ID.ToString(); return File(fileBytes, System.Net.Mime.MediaTypeNames.Application.Pdf, fileName); }
not System.Net.Mime.MediaTypeNames.Application.Pdf
return File(byte[], "application/zip", path + ".zip");
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)