2G 이상의 파일을 Http post method를 이용하여 업로드 시 오류
[환 경]
Windows server 2003 EE x86 + SP2 / IIS6.0
[문의사항]
2G 이상의 파일을 Http post method를 이용하여 업로드 시 오류가 발생 하는 원인 분석
[증 상]
2G 이상의 파일을 Http post method를 이용하여 업로드 시 오류가 발생
[원 인]
2GB이상의 파일을 업로드 하지 못하는 문제 원인은 대부분의 웹브라우저(IE, Chrome 등)에서 동일하게 나타나는 문제 입니다.
이는 HTTP Heaper인 Content-Length를 Signed Integer를 이용해서 구현하고 있기 때문 입니다.
32bit Signed Integer type은-2147483647 에서 2147483647가 유효한 값이며 이는 2GB 보다 큰 파일의 크기를 표현 할
수 없다는 뜻이 됩니다.
브라우저에 따라서 차이가 있을 수 있습니다만 현재 확인 가능한 대부분의 브라우저들이 2GB 이상 업로드 하는 경우 위에
설명 드린 이유로 잘못된 헤더 값을 서버에 전달하며 이 때문에 IIS가 400 Bad Request를 Return 하거나 Java Servlet에서
오류가 발생하는 등의 문제가 나타나게 됩니다.
대부분의 대용량파일 지원이 가능한 웹 포탈 사이트를 보면 어느 크기 이상의 파일을 업로드 하기 위해서 별도의 ActiveX control을
사용하고 있으며 이러한 문제들을 우회하여 해결하고 있습니다.
2GB upload limit for http uploads and very large forms - 100MB, 2GB (4GB) Article
http://www.motobit.com/help/scptutl/pa98.htm
Mozilla firefoxUpload file over 2GB - you cannot post such file, Mozilla does not send request with bigger file to server
Upload two or more files with size summary size >2GB - Mozilla send such files, but http headers are funny:
POST /content-length-test.htm HTTP/1.1
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US) Gecko/20060909 Firefox/1.5.0.7
Content-Type: multipart/form-data;
boundary=---------------------------28146504217367Content-Length: -1618952669
But IIS doesn't know what means "Content-Length: -1618952669" and it answers "Bad request"
Internet Explorer
The results with IE are similar - IE allows to post file over 2GB, but the http headers looks like in Mozilla:
POST /content-length-test.htm HTTP/1.1
Content-Type: multipart/form-data; boundary=---------------------------7d630d6400da
UA-CPU: x86
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; )
Content-Length: -107389343
Both major internet browsers simply count content-length of uploads in 32bit signed integer, so their results are unusable for very large uploads.
IIS HTTP GET and POST Limits
http://technet.microsoft.com/ko-kr/library/bb878118(en-us).aspx
MaxRequestEntityAllowed Metabase Property (IIS 6.0)
http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/468d6cea-04cd-4b10-b1e1-c17b9e909d07.mspx?mfr=true
감사합니다.^^