Previous Next

Thread: Physical file path in OnPreprocHeaders in an isapi filter

Last post 06-12-2008 1:22 PM by anilr. 1 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (2 items)

Sort Posts:

  • 06-10-2008, 9:48 PM

    • budimir1
    • Not Ranked
    • Joined on 06-11-2008, 1:37 AM
    • Posts 1

    Physical file path in OnPreprocHeaders in an isapi filter

    I want to know if the physical file for a particular url exists on my web site.  If the file exists physically then I want to allow it to continue on it's way untouched.  If not I want to send the request to my .net handler for processing as an alias (I'll add .aspx to the url somewhere to force it to .net).  The issue is, I can get the url in OnPreprocHeaders but I don't get the physical file name until OnUrlMap and by that time it appears that I've missed the bus.  I can't just redirect because I need to process any form data that may have been posted.  Is there some way to map a url to a physical file name while still in OnPreprocHeaders?  Thanks for your time.

  • 06-12-2008, 1:22 PM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 6:13 PM
    • Redmond, WA
    • Posts 1,090

    Re: Physical file path in OnPreprocHeaders in an isapi filter

    You could do it the other way - *-ScriptMap aspnet_isapi.dll so that all requests are seen by the asp.net pipeline and can be handled by your handler, and the ones you do not want can be returned back to IIS using the DefaultHttpHandler mechanism - no ISAPI filter needed.  Disadvantage would be that there would be performance degradation for stuff that you wanted IIS to handle anyway.

    If you want to stick with the current way - you can look up the physical path of the url yourselves from the metabase.

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
Page 1 of 1 (2 items)
Page view counter