0

I have created an HTTPHandler to handle all files within a certain folder ("Files"). When i run it locally from Visual Studio it works fine. However when i deploy it on the server (IIS 7, Classic Mode), the handler is not firing for files of types such as pdf, jpg, gif...etc (although requests for files with extensions .aspx, .axd...etc do work).

How exactly should i configure web.config to handle these files as well. I placed a web.config file inside the Files folder with the following:

<configuration>
    <system.web>
      <httpHandlers>
        <add verb="*" path="*.*" type="MyProject.Web.FileSecurityHandler, MyProject.Web"/>
      </httpHandlers>
    </system.web>
</configuration>

Please help...

ZiggY
  • 111
  • 1
  • 9

1 Answers1

0

add one more element in your HTTPHandler tag for specific file type for example

<configuration>
<system.web>
  <httpHandlers>
    <add verb="*" path="*.*" type="MyProject.Web.FileSecurityHandler, MyProject.Web"/>
   <add path="*.jpg,*.jpeg,*.bmp,*.tif,*.tiff" verb="*" type="NameofYourHandler" />
  </httpHandlers>
</system.web>
</configuration>
Mayank Pathak
  • 3,621
  • 5
  • 39
  • 67