Now write ActionResult like below
public ActionResult GetPDF(string fileName)
{
try
{
byte[] fileData = System.IO.File.ReadAllBytes(Functions.GetConfigValue("CDXFilePath") + fileName);
string resultFileName = String.Format("{0}.pdf", fileName);
Response.AppendHeader("Content-Disposition", "inline; filename=" + resultFileName);
return File(fileData, "application/pdf");
}
catch
{
return File(Server.MapPath("/Content/") + "FileNotFound.html", "text/html");
}
}