Reputation: 13437
I developed an HttpHandler
in order to count number of downloads for PDF files.
Now the problem is: How can I make IIS use my handler for PDF files?
Upvotes: 0
Views: 2599
Reputation: 2008
For IIS 7 it does depend on which mode you are running IIS in. Microsoft has a great tutorial on this How to: Register HTTP Handlers which goes over all the different configuration scenarios but assuming you are running IIS 7 in integrated mode and your handler is a compiled binary you would need a web.config entry similar to the following:
<configuration>
<system.webServer>
<handlers>
<add name="pdfCountHandler" verb="*"
path="*.pdf"
type="<your handler class name>, <your handler assembly name>"
resourceType="Unspecified" />
</handlers>
</system.webServer>
</configuration>
Upvotes: 2