Handler mappings in IIS7 and ASP.NET (VB) RRS feed

  • Question

  • Hi,

    I was hoping someone may be able to help. I have an ASP.NET web site running off IIS7. I am trying to implement a custom handler for different extension types (.pdf, .xls, .docx etc...). I have created a new class that implements IHttpHandler and edited the webServer > handlers section of my web.config file. When I attempt to process a .PDF file, the handler works like a charm - same with bitmaps and other files. My problem occurs when I try to process any MS Office documents - The handler class' ProcessRequest event just isn't being hit and the browser goes ahead and attempts to download the file in question. Anyone have any clues as where I may be going wrong?

    Here is a snippet from my web.cofig file

          <remove name="OPTIONSVerbHandler" />
          <remove name="TRACEVerbHandler" />
          <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
          <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
          <add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
          <add name="WijmoControlsHttpHandler" verb="*" preCondition="integratedMode" path="WijmoControlsResource.axd" type="C1.Web.Wijmo.Controls.WijmoHttpHandler, C1.Web.Wijmo.Controls.4, Version=4.0.20142.176, Culture=neutral, PublicKeyToken=9b75583953471eea" />
          <add name="PDF" path="*.pdf" verb="*" type="fwCommonWeb.FileProtectionHandler" resourceType="Unspecified" />
          <add name="XLS" path="*.xls" verb="*" type="fwCommonWeb.FileProtectionHandler" resourceType="Unspecified" />
          <add name="DOC" path="*.doc" verb="*" type="fwCommonWeb.FileProtectionHandler" resourceType="Unspecified" />

    Hope someone can help,

    Best regards

    Justin Davenport

    Tuesday, May 16, 2017 3:59 PM


All replies