代码之家  ›  专栏  ›  技术社区  ›  cbp

在iis7中由isapimodule处理jpg和gif

  •  2
  • cbp  · 技术社区  · 15 年前

    我正努力让我的httphandler处理jpg和gif的请求。

    我转到了网站的处理程序映射,并添加了以下行:

    Path: *.jpg,*.gif
    State: Enabled
    Path Type: Unspecified (I've also tried setting this to File)
    Handler: IsapiModule
    Entry Type: Local
    

    在visual studio作品中运行,所以我知道这不是我的代码。它也适用于iis6。

    我试过在经典模式和集成模式下设置应用程序。

    以下是web.config中指定的适当处理程序映射:

    <add name="*.jpg,*.gif_*" path="*.jpg,*.gif" verb="*" type="ThumbnailGenerator,Utilities" preCondition="integratedMode,runtimeVersionv2.0" />    
    <add name="JPEG-GIF" path="*.jpg,*.gif" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv2.0,bitness32" />
    
    1 回复  |  直到 15 年前
        1
  •  0
  •   cbp    15 年前

    我通过从web.config中清除处理程序,然后手动添加using-iis:[handler mappings]->[add managed handler]来解决此问题。

    我不知道这会有什么不同,因为web.config看起来和我之前安装的差不多,但是现在它可以工作了。