Reputation: 39
I put the file need to return in the content folder. If I want to return the file, what the path to use? Is there anyway that MVC can find reources in the content folder?
Upvotes: 0
Views: 463
Reputation: 1038780
No idea what content folder you are talking about but if we suppose that it is some sub directory:
public ActionResult Index()
{
return File(Server.MapPath("~/content/foo.txt"), "text/plain");
}
where ~
indicates the root of your web site.
Upvotes: 3