4
Reply

I would like to view a PDF file directly in my browser.

Avishkar Tamang

Avishkar Tamang

Mar 15 2017 7:16 AM
188
I would like to view a PDF file directly in my browser. I hvae the controller wriiten so far 
 
public ActionResult GetPdf(string fileName)
{
string filePath = "~/Content/Images/Vintagemenu/" + fileName;
Response.AddHeader("Content-Disposition", "inline; filename=" + fileName);
return File(filePath, "application/pdf");
}
 
 I need help with the view.

Answers (4)