Saturday, September 18, 2010

How to return a pdf file in MVC (instead of preview by browser)


public ActionResult GetPDF(string filename)
{
return File(filename, "application/pdf" , Server.HtmlEncode(filename));
}

No comments:

Post a Comment