如果我的网站目录中有文件:
~/documents/file1.pdf
如何强制对以下 url 的请求通过控制器:
www.mydomain.com/documents/file1.pdf
然后控制器看起来像
[Authorize]
public DocumentsController : Controller
{
public FileResult Index(string fileName)
{
//Check user has permission to view file
return File(...);
}
}