파일업로드시 404에러(용량제한, maxAllowedContentLength조절)


IIS6
<system.web>
       <httpRuntime executionTimeout="3600" maxRequestLength="2097151" />
</system.web>

executionTimeout단위  초
maxRequestLength 단위 MB



IIS7에서는 추가적으로 명시
 <system.webServer>
 <security>
  <requestFiltering>
   <requestLimits maxAllowedContentLength="2000000000" />
  </requestFiltering>
 </security>
</system.webServer>

maxAllowedContentLength 단위 Byte



-- 예제
관리자는 2GB까지 허용, 사용자는 20MB까지 허용
 <location path="/admin">
 <system.webServer>
  <security>
   <requestFiltering>
    <requestLimits maxAllowedContentLength="2000000000" />
   </requestFiltering>
  </security>
 </system.webServer>
</location>
<location path="/user">
 <system.webServer>
  <security>
   <requestFiltering>
    <requestLimits maxAllowedContentLength="20000000" />
   </requestFiltering>
  </security>
 </system.webServer>
</location>




----------
https://technet.microsoft.com/ko-kr/library/hh529949(v=exchg.150).aspx
Previous
Next Post »