Why you need an HTTPHandler
if you are working with ASP.NET MVC, Use an Action
method to server your file content. You can do most of the things you do with an HttpHandler
in an Action method. You can do the routing of the action as you wish like http://domainname.com/content/abc
can return the abc.pdf file
You should not directly let the browser to access the resource (PDF). Instead you give access via an action
method. Read the file Id /name in the action method from the request and read the file and output it. Assuming that you have an action method like below in your ResourceController
public ActionResult GetFile(string id)
{
string fullFilePath=somefullpathvariable+"//"+id+".pdf";
return File(fullFilePath, "application/pdf", Server.UrlEncode(id+".pdf"));
}
Now users can access this like
http://www.yourdomain.com/Resource/awesomemvc
Now this can return a file called awesomemvc.pdf
from a location which is stored in your server and your someFullPathVariable
holds the path to that location