简体   繁体   中英

httphandler intercepting all requests in IIS 6.0

I have written a httphandler to intercept pdf files request via URL from a specific folder and redirect the user to Login page. If the user is authenticated the file can be downloaded. My web.config has the following entry for the interception

<httpHandlers>
  <add verb="*" path="/calderdale/*.pdf"
       type="NES.HiLo.Security.CalderDaleAuthenticationHandler, NES.HiLo.Security" />
</httpHandlers>

My webserver is IIS 6.0 and I have added the Application Extension Mapping with executable " C:\\WINDOWS\\microsoft.net\\Framework\\v2.0.50727\\aspnet_isapi.dll " and Exntension .pdf and verbs to " All verbs "

All is working well except when a request for a public pdf document is made( not present in the specified directory ie calderdale) An error occurs on the page showing

"No data received....."

Any ideas how can we intercept pdf file requests just from the specified folder.

This has worked for me.

Right click the foldername in IIS where your protected files are present. Click Create Application. Click on Configuration and add mappings for the pdf files here. Now only this folders pdf files get intercepted.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM