i am trying to do something similar. when user requests a pdf file, i check if user has access to the file. if no access, redirect user to some other page. i am using HttpModule.
public void Init(HttpApplication app)
{
app.BeginRequest += BeginRequest;
}
public void Dispose()
{
}
private void BeginRequest(object source, EventArgs e)
{
HttpApplication app = (HttpApplication)source;
//check user has access to requested file
//if no access, redirect to errorpage
}
my problem is when pdf file is requested, BeginRequest method isn't called when debugging in IIS settings. it is called if i debug in website setting. i have registered the httpmodule in web.config file and
and also mapped .pdf extension aspnet_isapi.dll. so in IIS settings, pdf file is displayed even user don't have access to it. what am i missing? this thing is driving me insane........... [:@]
keeara
Participant
1092 Points
238 Posts
Re: HttpHandler intercepting PDF requests
Sep 03, 2007 08:25 AM|LINK
public void Init(HttpApplication app) { app.BeginRequest += BeginRequest; } public void Dispose() { } private void BeginRequest(object source, EventArgs e) { HttpApplication app = (HttpApplication)source; //check user has access to requested file //if no access, redirect to errorpage }my problem is when pdf file is requested, BeginRequest method isn't called when debugging in IIS settings. it is called if i debug in website setting. i have registered the httpmodule in web.config file and
and also mapped .pdf extension aspnet_isapi.dll. so in IIS settings, pdf file is displayed even user don't have access to it. what am i missing? this thing is driving me insane........... [:@]
any suggestions appreciated.
HttpModule
------------------