I am checking for the existence of a file bu cannot find it, regardless of whether it is there or not
if (System.IO.File.Exists("~/files/downloads/" + fileCode + ".pdf"))
{
return File("~/files/downloads/" + fileCode, "application/pdf", Server.UrlEncode(fileCode));
}
else
{
return View("ErrorNotExistsView");
}
How can I amend the code to check for the existence of the file correctly?
See Question&Answers more detail:os