I want to return a link to a PDF which will initiate a download on the client-side. I have a method that looks like this:
public ActionResult DownloadPdf()
{
return File("bitcoin.org/bitcoin.pdf", "application/pdf", Server.UrlEncode("bitcoin.org/bitcoin.pdf");
}
I always get a System.IO.DirectoryNotFoundException because my URL gets used as a relative path (something like C:\mydir\bitcoin.org\bitcoin.pdf is searched for and not found). How can I return something hosted elsewhere?