반응형

 

web.config는 ASP.NET의 핵심 파일인거 같다.

다양한 역할 및 중요한 역할을 수행하기에 너무 중요한 파일이다.

업로드를 할 수 있는 파일 용량을 web.config에서 제어할 수 있다. 천천히 따라해보자.

 

예제

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<system.web>
    <!-- 1MB = 1024bytes -->
    <httpRuntime targetFramework="4.5" executionTimeout="3600" maxRequestLength="51200" />
</system.web>
<system.webServer>
    <security>
        <requestFiltering>
                <!-- maxAllowedContentLength 단위는 Kilobyte,  1MB = 1048576KB -->
                <!-- IIS에서 핸들링 -->
                <requestLimits maxAllowedContentLength="52428800" />
        </requestFiltering>
    </security>
</system.webServer>
 
cs

 

기본적으로 업로드 용량은 4MB 이다. 기억하자.

그리고 maxAllowedContentLength 단위가 Kilobyte 이기에, 기본적인 단위의 크기에 대해 알아본다.

 

단위 크기

  • 1024 bytes = 1KB
  • 1024 KB = 1MB
  • 1024 MB = 1GB
  • 1024 GB = 1TB
  • 1024 TB = 1PB

KB = Kilobyte , MB = Megabyte, GB = Gigabyte, TB = Terabyte, PB = Petabyte

간단한 내용이지만 숙지하자.

 

 

 

반응형

+ Recent posts