2012-07-17 3 views
0

특정 폴더 ("파일") 내의 모든 파일을 처리하기 위해 HTTPHandler를 만들었습니다. Visual Studio에서 로컬로 실행할 때 제대로 작동합니다. 그러나 서버 (IIS 7, 클래식 모드)에서 배포 할 때 처리기가 pdf, jpg, gif ... 등의 파일 유형에 대해 실행되지 않습니다 (확장명이 .aspx, .axd 인 파일에 대한 요청 임에도 불구하고 ..). .etc 작동).디렉토리의 모든 파일에 대한 HTTPHandler

정확히 어떻게 이러한 파일을 처리하도록 web.config를 구성해야합니까? 나는 다음과 파일 폴더 안에 web.config 파일을 배치 :

답변

0

예를 들어 특정 파일 형식에 대한 HTTPHandler 태그에 또 하나 개의 요소를 추가 ...

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

이 도와주세요

<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> 
관련 문제