I have a "Gallery" folder with one pdf file
I view the pdf file using an object, then I need to download that pdf by clicking a "Click here to download the pdf file" link
please help me,
I view the pdf file using an object, after that below I have "Click here to download the pdf file " when I click that link I want able to download the pdf
here's the code I have so far:
public ActionResult downloadpdf()
{
using (var client = new WebClient())
{
var buffer = client.DownloadData("~/Gallery/NewsBulletin.pdf");
return File(buffer, "application/pdf", "mypdffile.pdf");
}
}
If file isn't in site directory, you can still specify the full path in controller action, i.e.