locked
Http handler not firing in sub virtual directory RRS feed

  • Question

  • User652143176 posted

     

     Hi,

    I have the following

     (Default Website)

    ---> Web application (ASP.NET 2.0 app)

    --> --> Virtual directory (http://localhost/webapp/downloads pointing to C:\FileStore)

     

    I also have the following http handler config items in my web.config for the web application:

           <remove verb="*" path="*.gif" />
          <remove verb="*" path="*.jpg" />
          <remove verb="*" path="*.png" />
          <add verb="*" path="*.gif" type="Website.Common.Images.CachingHandler, Website" />
          <add verb="*" path="*.jpg" type="Website.Common.Images.CachingHandler, Website" />
          <add verb="*" path="*.png" type="Website.Common.Images.CachingHandler, Website" />

     I have links looking at the virtual directory (http://localhost/webapp/downloads/gallery/image01.jpg) but this is not using the HTTP handler I have set. I thought any config set at this level would go down to any items below?

    The http handler is in the web app assembly.

    Any ideas? I am using IIS 6.
    Monday, February 16, 2009 7:54 AM

Answers

  • User-1136466523 posted

    Hi,

    From your description, it seems that the handler does not work in the virtual directory. Have you tried that if the handler can work in the default website folder or any other virtual folder? If it still can't work, you need to try the settings in IIS, make sure that the file with gif,png and jpg extensions should be passed to ASP.NET to handler.

    Thanks.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, February 18, 2009 11:59 PM

All replies

  • User652143176 posted

    Any ideas?

    Tuesday, February 17, 2009 10:21 AM
  • User-1136466523 posted

    Hi,

    From your description, it seems that the handler does not work in the virtual directory. Have you tried that if the handler can work in the default website folder or any other virtual folder? If it still can't work, you need to try the settings in IIS, make sure that the file with gif,png and jpg extensions should be passed to ASP.NET to handler.

    Thanks.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, February 18, 2009 11:59 PM
  • User781103784 posted

    I have a very similar problem to the above, also on IIS6.

    I have an httphandler configured on my web application, for FLV files. It works well for any FLV files in the web application's virtual directory.

    <add verb="*" path="*.flv" type="FlvHandler.FlvStreamHandler, FlvHandler" />

    But I have created another virtual directory, "nested" inside the main one. If I put an FLV file in there and request it, I see an error "Could not load file or assembly 'FlvHandler' or one of its dependencies. The system cannot find the file specified."

    I have correctly set up the .flv file type in the application extensions list of the virtual sub-directory.

    But here's the interesting thing. I go to the folder that the virtual sub-directory points to, add a "bin" folder, and put another copy of the "FlvHandler.dll" in there, and everything is fine!

    So it seems that when a request is made to the sub-directory, IIS is looking at the web.config in the parent directory, but then trying to find the FlvHandler.dll in the sub-directory, not the parent...

    Is there a way around this?

    Thanks for any help.

    Monday, May 11, 2009 10:48 AM
  • User781103784 posted

    Sorry to "bump" this question, my fault for tagging a question to the end of a thread that's already been answered!

    Hope someone who is less of a dunderhead than me can have a think about it though. What I guess I need is some way to specify an absolute path to a .dll in the config file httphandler elements - is that feasible?

     

    Thursday, May 14, 2009 8:22 AM